Skip to main content
11 votes

Craft Vs Drupal?

If you are a php developer Craft will be the more interesting option because it uses the great Yii framework that provides many good tools. A few years ago we decided to drop our custom CMS ...
Robin Schambach's user avatar
8 votes
Accepted

Craft Commerce: Dynamic Product Price

[** Updated Dec 2016] I think at this stage the best approach will be plugin based. Create a business logic plugin if you haven't already. Two good ways of doing that are : Business Logic Plugin ...
Jeremy Daalder's user avatar
6 votes
Accepted

Cart Items Total to include qty of variants

You can get the total quantity of items with: cart.totalQty Docs: https://craftcommerce.com/docs/order-model#totalqty
Luke Holder's user avatar
  • 6,837
6 votes
Accepted

Commerce: what is the purpose of a line item's snapshot?

The snapshot is there so that the key details of an order are forever more available on the order record. Imagine living with Commerce for a long time - you will of course most likely add, change and/...
Jeremy Daalder's user avatar
5 votes

What are the issues with adding Craft Commerce to an existing Craft CMS site?

You should absolutely use Craft Commerce to store the products, as there is no migration from Entries -> Craft Commerce products. You don’t need to pay for a Craft Commerce license if you are not ...
Patrick Harrington's user avatar
5 votes
Accepted

How do you gain PCI compliance without certifying your server for Craft, with or without Commerce?

The takeaway is to use api packages provided by payment providers such as Stripe and Authorize.net. The Craft Charge plugin can very much simplify and smooth doing so with Stripe. Here's a link to a ...
narration_sd's user avatar
  • 1,707
5 votes
Accepted

Craft Commerce: Sort Products By Price

Close! This should do it: {% set products = craft.commerce.products({ relatedTo: (category), order: 'defaultPrice', }) %} With the quotes it's a string. Without the quotes, Twig is ...
Brad Bell's user avatar
  • 67.5k
4 votes
Accepted

Getting image for product in Cart Screen

This actually depends where the image is stored - if the asset (image) field is on the product, and is called myImage, then as per Brad's example you'd use: lineitem.purchasable.product.myImage ......
Jeremy Daalder's user avatar
4 votes
Accepted

Craft Commerce: Custom address model validations

You can do either or both of: Use javascript validation on the front end (with e.g. parsley) Create a plugin with a method that is registered as a listener on this event: https://craftcommerce.com/...
Jeremy Daalder's user avatar
4 votes

Simple webshop solution (Craft Commerce)?

You could use https://snipcart.com/, with the product data populated via Craft fields, for an easy/low-cost solution. No plugin required for this - although https://superbig.co/plugins/snipcart is in ...
James Greig's user avatar
4 votes
Accepted

Partially pay for an order

This is certainly still possible with Commerce 3 and Craft 3. In a custom plugin or module you can listen for the Transactions::EVENT_AFTER_CREATE_TRANSACTION event and amend the transaction amount at ...
Steve Rowling's user avatar
3 votes

Developers Needed

I'd recommend you join the Craft Slack and post this in the #jobs channel, you might get a better response! https://craftcms.com/community#slack
Jamie Jenkins's user avatar
3 votes

Have the country in craft.commerce.countriesList default

I needed to add the country values to the array so used Brad's answer to come up with the following: {% set countryList = [{'77':'United Kingdom'},{'233':'United States'}] %} {% for key, country in ...
Luke Pearce's user avatar
  • 3,863
3 votes

Option and notes fields after cart at checkout for order, not just line items

First, add a custom field to your orders, let's call it orderNotes. Then, in any updateCart form, you can use an input with name="fields[orderNotes]" to set the value of that field. (Line items ...
Jeremy Daalder's user avatar
3 votes
Accepted

How do you show which Sale a product has applied in Commerce?

The real answer is: {% for sale in variant.sales %} {% sale.description %} {% endfor %}
Luke Holder's user avatar
  • 6,837
3 votes

Can I use Craft CMS for a large custom web application?

Craft isn't opinionated on how your site works; it just organizes and outputs your content however you want it to. You have 100% control over your HTML whether you want to use templates or dish out ...
Ryan's user avatar
  • 1,952
3 votes

Craft Commerce > 2.2: How can you order line items?

I am posting the answer of Craft Commerce Support in case somebody stumbles over the same thing: It is possible to order them differently if required. The code example below shows how to order them ...
outline4's user avatar
  • 595
3 votes

How to create a faceted search/facet filter in Craft Commerce

Answer edited 2022: I've now written a blog post tutorial on how to do multi-faceted search filtering natively: https://cld.agency/blog/multi-faceted-filtering-in-craftcms I've done this a few times ...
James Smith's user avatar
  • 5,344
2 votes

Craft Commerce: How to manage different prices with one product?

Craft Commerce support has answered to my question : Currently Craft Commerce can not have a stock counter that covers more than one variant. The default product+variant system is not designed ...
Romain P.'s user avatar
  • 1,852
2 votes

Getting image for product in Cart Screen

You'd access the product images just like you would any other Assets field in Craft. Assuming you've already got the cart, and your Assets field is called productImages, something like this should ...
Brad Bell's user avatar
  • 67.5k
2 votes
Accepted

Edit a single address in Commerce

Are you looking for something like this? The second example will ensure an address variable exists, even if it is set to null. {% set address = craft.commerce.customer.address(addressId) %} or {% ...
Luke Holder's user avatar
  • 6,837
2 votes
Accepted

Extending Craft Commerce admin templates

It's not documented on the Commerce site (yet), but Commerce does have commerce_addProductActions and commerce_addOrderActions hooks that a plugin could latch onto to add its own custom actions to the ...
Brad Bell's user avatar
  • 67.5k
2 votes

Craft Commerce, variable product prices based on weight. Is this possible?

1oz = $1 ∴ 10oz = $10 Sell in units of weight as the quantity of the item.
Steve Adams's user avatar
  • 1,671
2 votes
Accepted

POS integration with Craft Commerce

It's totally possible. However, since there is no existing plugins for this that is readily available, you'd have to create a custom plugin to do it. If you have the necessary coding chops, you can ...
Fred Carlsen's user avatar
  • 2,997
2 votes
Accepted

How can I break up a product into two page templates?

I think you just need to create a dynamic route to either ignore customise/ in the url or serve up a different template altogether. See my answer on this ticket for more information. Secondary ...
Ryan's user avatar
  • 1,952
2 votes

Craft Commerce: make address phone telephone field required without JavaScript

The way to do address validation with Commerce in gneral is using a plugin and listening to the onBeforeSaveAddress event. Set up a listener with something like this: craft()->on('...
Jeremy Daalder's user avatar
2 votes
Accepted

Option and notes fields after cart at checkout for order, not just line items

You could create a special product for the gift wrapping and offer to add it to the cart during the checkout process with a separate updateCart form. As for the notes, you can add a custom field to ...
foamcow's user avatar
  • 2,029
2 votes
Accepted

Can I have a Craft Commerce product with options that change the product’s price?

Absolutely that is possible. You can see an example of a complex options set up here for example (click Add Prints to get going...): https://imagescience.com.au/services/fine-art-printing/order-fine-...
Jeremy Daalder's user avatar
2 votes

Link to the product from the shopping cart

{{ item.purchasable.url }} should do it.
Luke Holder's user avatar
  • 6,837
2 votes
Accepted

Dynamically update line item in Commerce 2

Turns out I just replace: $cart->addLineItem($lineItem); With: CommercePlugin::getInstance()->getLineItems()->saveLineItem($lineItem, false);
Jason Mayo's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible