Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
integration:craftcms [2014/08/05 14:23] – adam | integration:craftcms [2019/01/22 14:14] (current) – [Webhooks] adam | ||
---|---|---|---|
Line 1: | Line 1: | ||
---- dataentry | ---- dataentry | ||
type : integration # do not change this line | type : integration # do not change this line | ||
- | systems | + | systems |
- | name : CraftCMS | + | name : Craft CMS + FoxyCart # the name of the integration |
- | description | + | description |
tags : cms # tags, separated by commas. don't include the " | tags : cms # tags, separated by commas. don't include the " | ||
date_dt | date_dt | ||
Line 9: | Line 9: | ||
developer_url : # if you'd like a link back to your site, stick it here | developer_url : # if you'd like a link back to your site, stick it here | ||
---- | ---- | ||
+ | |||
Line 55: | Line 56: | ||
**Decimal Points:** 2 | **Decimal Points:** 2 | ||
- | Those two fields are the only required pieces of information you need for a product to be valid with FoxyCart. There are some other default product attributes that come with FoxyCart that you can [[http:// | + | Those two fields are the only required pieces of information you need for a product to be valid with FoxyCart. There are some other default product attributes that come with FoxyCart that you can [[http:// |
+ | |||
+ | **Name:** Code\\ | ||
+ | **Handle:** '' | ||
+ | **Field Type:** Plain text | ||
**Name:** Category\\ | **Name:** Category\\ | ||
Line 69: | Line 74: | ||
**Note:** You will need to configure an asset source if you haven' | **Note:** You will need to configure an asset source if you haven' | ||
+ | **Name:** Colour\\ | ||
+ | **Handle:** '' | ||
+ | **Field Type:** Table\\ | ||
+ | **Table Columns: | ||
+ | * **Column Heading:** Label | ||
+ | * **Handle:** '' | ||
+ | * **Type:** Single-line Text | ||
+ | |||
+ | * **Column Heading:** Value | ||
+ | * **Handle:** '' | ||
+ | * **Type:** Single-line Text | ||
+ | |||
+ | * **Column Heading:** Default? | ||
+ | * **Handle:** '' | ||
+ | * **Type:** Checkbox | ||
+ | * **Width:** 45 | ||
==== Create section ==== | ==== Create section ==== | ||
- | {{ : | + | {{ : |
Now navigate to ' | Now navigate to ' | ||
- | Once that is created, click on the 'Edit entry type' that appears next to it's listing in the " | + | Once that is created, click on the 'Edit entry type' that appears next to it's listing in the " |
Save those changes. | Save those changes. | ||
Line 86: | Line 107: | ||
{% block content %} | {% block content %} | ||
- | < | + | |
- | {% for entry in craft.entries.section(' | + | |
- | < | + | < |
- | {% set image = entry.image.first() %} | + | {% set image = entry.image.first() %} |
- | {% if image %} | + | {% if image %} |
- | <img src=" | + | <img src=" |
- | {% endif %} | + | {% endif %} |
- | < | + | < |
- | < | + | < |
- | < | + | < |
- | </ | + | </ |
- | {% endfor %} | + | {% endfor %} |
{% endblock %} | {% endblock %} | ||
</ | </ | ||
=== _product.html === | === _product.html === | ||
- | |||
- | Make sure you replace the store domain in the add to cart form in this code. | ||
<code html>{% extends " | <code html>{% extends " | ||
{% block content %} | {% block content %} | ||
- | {% set image = entry.image.first() %} | + | |
- | + | ||
- | < | + | |
- | < | + | |
- | < | + | |
- | {% if image %} | + | |
- | <img src=" | + | |
- | {% endif %} | + | |
- | {{ entry.body }} | + | |
- | <form action=" | + | < |
- | <input type=" | + | < |
- | <input type=" | + | < |
- | <input type=" | + | {% if image %} |
- | {% if image %} | + | <img src=" |
- | <input type=" | + | {% endif %} |
- | {% endif %} | + | {{ entry.body }} |
- | <label for=" | + | |
- | <input type=" | + | <input type=" |
- | <input type=" | + | <input type=" |
- | </ | + | < |
- | </ | + | |
+ | {% if image %} | ||
+ | <input type=" | ||
+ | {% endif %} | ||
+ | <label for=" | ||
+ | <input type=" | ||
+ | {% if entry.colour | length %} | ||
+ | <label for=" | ||
+ | <select name=" | ||
+ | {% for row in entry.colour %} | ||
+ | <option value=" | ||
+ | {% endfor %} | ||
+ | </ | ||
+ | {% endif %} | ||
+ | | ||
+ | </ | ||
+ | </ | ||
{% endblock %} | {% endblock %} | ||
</ | </ | ||
Line 150: | Line 177: | ||
===== Simple as that! ===== | ===== Simple as that! ===== | ||
- | {{ : | + | {{ : |
- | Getting FoxyCart integrated into CraftCMS | + | |
+ | Getting FoxyCart integrated into Craft CMS is as simple as that - and thanks to the flexibility and power of Craft, you can very quickly and easily set up products that match exactly the structure your products need. You can also display them however you need, with complete control over the templates for Craft, as well as the templates for your FoxyCart store. | ||
Obviously you'll need to apply some styling love to the templates - this should at least give you a great starting point to getting a FoxyCart powered store into your Craft website. | Obviously you'll need to apply some styling love to the templates - this should at least give you a great starting point to getting a FoxyCart powered store into your Craft website. | ||
Line 157: | Line 185: | ||
===== Other Plugin Features ===== | ===== Other Plugin Features ===== | ||
- | ==== HMAC Encryption | + | ==== Link/Form Validation |
- | If you'd like to make use of our [[static: | + | If you'd like to make use of our [[static: |
<code html>{% extends " | <code html>{% extends " | ||
{% block content %} | {% block content %} | ||
- | {% set image = entry.image.first() %} | + | |
- | < | + | |
- | < | + | < |
- | < | + | < |
- | {% if image %} | + | {% if image %} |
- | <img src=" | + | <img src=" |
- | {% endif %} | + | {% endif %} |
- | {{ entry.body }} | + | {{ entry.body }} |
- | {% hmac %} | + | {% hmac %} |
- | <form action=" | + | <form action=" |
- | <input type=" | + | <input type=" |
- | <input type=" | + | <input type=" |
- | <input type=" | + | < |
- | {% if image %} | + | |
- | <input type=" | + | {% if image %} |
- | {% endif %} | + | <input type=" |
- | <label for=" | + | {% endif %} |
- | <input type=" | + | <label for=" |
- | <input type=" | + | <input type=" |
- | </ | + | {% if entry.colour | length %} |
- | {% endhmac %} | + | <label for=" |
- | </ | + | <select name=" |
+ | {% for row in entry.colour %} | ||
+ | <option value=" | ||
+ | {% endfor %} | ||
+ | </ | ||
+ | {% endif %} | ||
+ | | ||
+ | </ | ||
+ | {% endhmac %} | ||
+ | </ | ||
{% endblock %} | {% endblock %} | ||
</ | </ | ||
Line 194: | Line 231: | ||
Navigate to the FoxyCart Craft plugin' | Navigate to the FoxyCart Craft plugin' | ||
- | If you need to perform custom actions with that data (for example, you may need to subscribe a customer to a mailing list), you can make use of the '' | + | If you need to perform custom actions with that data (for example, you may need to subscribe a customer to a mailing list), you can make use of the '' |
+ | |||
+ | <code php> | ||
+ | craft()-> | ||
+ | $xml = $event-> | ||
+ | $feedType = $event-> | ||
+ | |||
+ | // .. your code | ||
+ | }); | ||
+ | </ | ||
+ | For an example of the payload you'll receive, you can review those on their respective wiki pages - [[v: | ||
==== Single Sign-On ==== | ==== Single Sign-On ==== | ||
Line 206: | Line 253: | ||
===== Taking this further ===== | ===== Taking this further ===== | ||
- | While this integration covers a lot of ground getting FoxyCart integrated into a Craft website, it can certainly be taken even further. If you'd like to add additional features and functionality into the FoxyCart plugin for Craft, feel free to [[submit a pull request|https:// | + | While this integration covers a lot of ground getting FoxyCart integrated into a Craft website, it can certainly be taken even further. If you'd like to add additional features and functionality into the FoxyCart plugin for Craft, feel free to [[https:// |