Jeremy Daalder
  • Member for 7 years, 7 months
  • Last seen this week
Why choose Craft Commerce over Magento
Accepted answer
22 votes

Obviously it's going to depend on each specific project, and I can only talk from my own (store owning) perspective, but over the years I have evaluated and installed and played with just about every ...

View answer
Order Confirmation Email in Craft Commerce
Accepted answer
8 votes

To setup/debug email issues in commerce it's easiest to set up the simplest possible email and work your way up from there. Check your Craft email settings - can you send & receive the test email ...

View answer
Craft Commerce: Dynamic Product Price
Accepted answer
8 votes

[** 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 ...

View answer
3 for 2 etc with Craft Commerce
Accepted answer
7 votes

The documentation for adjusters is here: https://craftcommerce.com/docs/adjusters and https://craftcommerce.com/docs/order-adjustment-model Essentially your plugin creates a class that fulfils the ...

View answer
Update Commerce Cart using Ajax
Accepted answer
7 votes

Yes, you can do all the normal commerce actions via ajax. A basic recipe is this... HTML: <form method="POST" id="addToCartForm"> {{ getCsrfInput() }} <input type="...

View answer
Ordering of products?
Accepted answer
7 votes

Product types are really all about data concerns - so if the data you're storing for your canines/equines (hereafter known as dogs and horses to save some typing ;) ) - is the same, then you're right ...

View answer
Commerce: what is the purpose of a line item's snapshot?
Accepted answer
6 votes

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/...

View answer
Setting Shipping Country and Method for the Cart screen
Accepted answer
6 votes

I agree with the basic underlying premise that showing full cost - i.e. with shipping - is essential on the cart index page for a modern checkout. Customers loathe what they see as a hidden surprise ...

View answer
Transaction Error Message in Template
Accepted answer
6 votes

The error messages are returned to the template as flash messages. Handling those is documented here: https://craftcms.com/docs/templating/craft.session One thing to watch out for is that flash ...

View answer
Is it possible to make links open in a new tab by default?
6 votes

Merits of doing this aside, I agree that JS is probably the easiest way to go here. This code adds target="_blank" to all external links. // Make sure any offsite links (non js/mailtos) open in a ...

View answer
How can I display a message after login?
6 votes

There's no need for a plugin here. Craft sets a notice flash message by default on login/logout that you can check for: Logged in. (If there is an error it will return the error (and your form ...

View answer
Dealing with missing images
6 votes

I do all images through a macro, that substitutes in our logo if an image happens to be missing. {% macro imageTransform(image, transform, caption, extraHTML) %} {# Fallback to our logo if the ...

View answer
How do you reset a cart under Craft Commerce 2?
5 votes

Depending on context, here's another handy way of clearing the cart for Commerce 2/3 In a template, you can put: {% do cart.setLineItems([]) %} {% do craft.app.elements.saveElement(cart) %} You ...

View answer
Is it possible to separate variant options on a front end add to cart form?
Accepted answer
5 votes

It's definitely possible and doesn't really need any custom back end code to be done in general. Ultimately all add to cart options in Commerce are just a simple case of POSTing the variant id and ...

View answer
Craft Commerce: Hard code different product prices based on currency?
Accepted answer
5 votes

You can add custom fields to store the 'other' price for your products (and/or variants), like, as you say, a matrix, or probably even a table would do. The fields can then be edited by admins in the ...

View answer
Confused about tags
Accepted answer
5 votes

You told Craft to look for tags/_tag And then you created templates/tags/_tags.html Note you have no s on the end in the route definition, but you do in the template name.

View answer
How can I set a BOGOF (Buy One, Get One Free) promotion using Craft Commerce?
5 votes

I've used a relatively simple plugin to listen to commerce_cart.onBeforeAddToCartwhich checks what is being added to a cart and if it is a certain item it will automatically add the free item to the ...

View answer
How do I export search results as a csv?
Accepted answer
5 votes

You can just make link to a twig template to output a csv quite simply...just like any other template really, except it won't extend you layout etc. and will simply contain something like: {%for ...

View answer
Notify users when item is back in stock
Accepted answer
5 votes

This is not currently possible out of the box with Commerce at time of writing (Sept 2016). You could write a custom plugin to do it, which would basically keep a table of these people-to-contact, ...

View answer
Can notes on line items be updated on checkout?
5 votes

I use ajax autosave to achieve this, and ajax update the cart in the background (for notes, but also pretty much everything else). I essentially use the recipe from: from https://github.com/...

View answer
Zero dollar Commerce orders - payment how-to?
Accepted answer
4 votes

Stripe, like most payment providers will most likely not allow $0 payments. In this case, the typical approach is to set up the manual gateway in addition to stripe, and detect if order.totalPrice ...

View answer
date in database -1 day as on frond-end
Accepted answer
4 votes

The database will be storing the date as seconds since 1970 (epoch) and your view on that is not localised. However, the front end date is localised for your time zone. Of this I am more sure than ...

View answer
(Commerce) Multiple line items with the same purchasable ID?
Accepted answer
4 votes

Commerce will by default combine line items that have the same hash value for the options (that is, the values of the items chosen options are run through md5 to get a hash - if the hash matches, the ...

View answer
Most efficient way to check if a section has any active entries
Accepted answer
4 votes

Not a definitive answer at all, but you could at least add a .ids() on that so it only retrieves the entry ids and not all the entry data... {% if craft.entries.section('whatever').ids() | length >...

View answer
Commerce: How to implement/save 'Use shipping for billing' field for future orders
Accepted answer
4 votes

We achieve this by simply checking the ids of the addresses set on the cart. Commerce saves the last used shipping and billing address for customers, so you can just use some simple template logic to ...

View answer
How to make plugin developer name available in templates?
Accepted answer
4 votes

Data in plugins is not automatically made available to twig templates. To make something available, you need to create a folder in your plugin master folder called variables and in that folder create ...

View answer
List Orders with datePaid is within last 14 days using the Element API plugin
Accepted answer
4 votes

Here's an example elementapi.php that should get you going...this is returning shipping details but you can modify the transformer for whatever data you need of course... return [ 'endpoints' => [ ...

View answer
Getting started with Order Adjuster plugin
Accepted answer
4 votes

To get an adjuster working, it's really all about consistent naming and making sure PHP can find the class. Here are the main things to address: Your adjuster should be defined in a file that ...

View answer
Update cart lineItems through ajax
Accepted answer
4 votes

There are two major approaches. The easier approach is to create a partial template that displays the cart lineItems, and simply ajax load that template in to a div that is your cart display after ...

View answer
Can I use an IP address instead of a FQDN?
4 votes

First, I can positively confirm I have Craft running on two not hosted, local servers - one a Ubuntu 14.04 (well, Mint) installation, and one a Windows box using Uniserver. Not sure quite what you're ...

View answer
1
2 3 4 5
8