Questions tagged [plugin-craftcommerce]
Use this tag for questions relating to the Craft Commerce product.
833
questions
14
votes
1
answer
2k
views
Issues with Craft Commerce and VAT taxes
We've just completed our first Craft Commerce website at Base Design. Overall everything went well but we encountered issues with taxes and the way VAT works on online sales in the EU. Craft Commerce ...
9
votes
2
answers
924
views
3 for 2 etc with Craft Commerce
I'm looking for a way to offer "3 for 2 / 2 for 1" type options with Commerce.
I've been able to achieve this just by adding a default value to a coupon code input.
It works, kinda. If we need to ...
9
votes
1
answer
346
views
How do you gain PCI compliance without certifying your server for Craft, with or without Commerce?
This is going to be informational, as we had a good conversation over this area on Craft Slack. And good fun trying to get around the idiotic StackExchange 'subjective' monitor to publish it here -- ...
8
votes
1
answer
468
views
Using Commerce to pay for posting entry
I'm trying to figure out how to do the following:
Person registers as new user
User creates a new entry with a front-end entry form
Entry is saved as disabled so it's not publicly visible
User has ...
8
votes
1
answer
2k
views
Craft Commerce: Dynamic Product Price
Rather than a static price for each product, I need the price to be dynamic based on two other fields of that product. Here's an example of what I need to accomplish:
Product
Field 1: Wholesale Cost ...
7
votes
3
answers
2k
views
Craft Commerce: Validation on Address Fields
Can someone break down how I should validate empty address fields as a plugin for Craft Commerce and take the following answer further?
The Craft Commerce documentation provides the following example ...
7
votes
2
answers
290
views
Notify users when item is back in stock
Is it possible to let customers enter their email on individual product pages if the stock is 0, and then automatically send them an email when the stock goes above 0 again?
6
votes
2
answers
3k
views
Why choose Craft Commerce over Magento
We have 2 clients that want to have an online shop website. One with 100 products, with 10,000 products.
We've built 100's of websites, but no e-commerce sites yet. We're in the stage of writing the ...
6
votes
1
answer
3k
views
How can I update custom order fields in the frontend
I am struggling with using additional custom order fields. (Added in the Craft Commerce settings at "order fields", in the field layout manager)
I try to update them like this in the checkout process:...
5
votes
2
answers
715
views
Craft Commerce: Displaying Individual Product Options in the Cart?
In the cart example code the selected options are displayed in an unformatted list like so:
{{ item.options|json_encode }}
I noticed that the note field text could be outputted individually like so:
...
5
votes
1
answer
718
views
Commerce & PayPal - What does "Solution Type" mean?
Our site is using the Craft Commerce plugin, and within that we've enabled the PayPal Express gateway. However, there is a very cryptic dropdown menu on the gateway settings page...
So my question is,...
5
votes
1
answer
2k
views
Update Commerce Cart using Ajax
Is there a way to update the cart using ajax?
I've tried something like:
$('span.quick-cart-add>p>a').click(function(e){
e.preventDefault();
var data = {};
...
5
votes
1
answer
1k
views
One-Page Commerce Checkout
Does anyone have any recommendation on how to reformat the Commerce checkout workflow to be on one page? More specifically, how to pass the address/customer info before the payment info without having ...
5
votes
1
answer
1k
views
Ordering of products?
What is the best method to organise products, and subsequently the order of these products within a group?
Currently I have setup a product type of Canine. I can access each of these products via a ...
5
votes
2
answers
508
views
List only Orders containing specific Products
Each Product has a Merchant field which is standard Craft User. What I'd like to do is list out all Orders which contain one or more Products relating to the currentUser. I was hoping I'd be able to ...
5
votes
2
answers
1k
views
Include tax in price on product page
Is it possible to include any tax values in the price on the products page (not just the cart)?
5
votes
1
answer
1k
views
Managing a large number of Variants in Craft Commerce
I'm currently building a site for a client who's products vary in price depending on the width / height selected. Essentially what this means is each product has around 70 possible variations, each ...
4
votes
2
answers
623
views
Craft Commerce: Detecting & Styling Flash Messages?
I'm styling my flash messages in Craft Commerce - I added if statements to detect the type of flash message. I noticed however that the message no longer displays but the styling does get picked up. ...
4
votes
2
answers
949
views
Craft Commerce not sending E-Mails immediately
I have an e-mail problem at Craft Commerce.
Emails are not sent at the time of purchase.
The e-mail is only sent when you log in to the backend.
I first thought it was a server queue problem. But ...
4
votes
3
answers
2k
views
Setting Shipping Country and Method for the Cart screen
I want to set the default countryId and a default shipping method (there is only one shipping method but contain several rules), so that the cart screen shows this and we can then present a shipping ...
4
votes
1
answer
2k
views
Order Confirmation Email in Craft Commerce
I am having trouble with emails being sent by Commerce. Checked my settings in Craft and sent test email. Works. Followed Commerce docs in setting up email. Double checked, but still does not work....
4
votes
1
answer
284
views
Check if an order has been refunded in a template?
What’s the best way to check if an order has been refunded in a template?
For example, you may want to:
Add a message to the order/invoice template if a refund has been successful.
Determine the ...
4
votes
1
answer
788
views
Changing base currency
I set up a new shop and the base currency is US dollars. However I want to change this to Euro's. How can I do this?
In Commerce --> Settings --> Payment Currencies I can add new currencies but I can'...
4
votes
1
answer
651
views
(Commerce) Multiple line items with the same purchasable ID?
I'm using onPopulateLineItem in my plugin to dynamically set the price of products added to the cart based on user input on the front-end -
$lineItem = $event->params['lineItem'];
$size = craft()-...
4
votes
1
answer
1k
views
Update cart lineItems through ajax
How do I update the lineItems after I submit the form through ajax? right now it adds the item, but it doesn't show up in the cart, it only shows up when I reload the page.
I am adding an item to ...
4
votes
1
answer
318
views
Default price in Craft Commerce
I have a Product Type where every product has the same price. What are some good ways to avoid having to enter this same price for every product?
4
votes
1
answer
802
views
Craft Commerce: How do I handle quantity based discounts on a product level?
I'm curious what the best way to handle quantity discounts would be on a product/variant level. For example:
The base price of a variant is $3 each, but if you buy 10-19 they're $2 each, and if you ...
4
votes
1
answer
512
views
How do I actually add a Digital Product to an order?
I'm trying to use the fresh new Digital Products plugin in my website.
I managed to create some products and assigned licenses, I see some licenses when I log in as an end user - but the last link ...
4
votes
1
answer
828
views
Commerce: How can I dynamically create a discount for any given product?
I am inspecting my cart when the user visits /commerce/cart and if the cart contains a specific product, I want to alert the user that they can redeem a credit for "x" item. If the users chooses to ...
3
votes
2
answers
2k
views
How do you reset a cart under Craft Commerce 2?
How do you reset or empty the cart, in Commerce 2? There is no mention of this in the documentation.
In Commerce 1, it was possible to issue a request to the commerce/cart/removeAllLineItems action ...
3
votes
2
answers
2k
views
How do I check if a product has stock in any of it's variants?
Basically, I'm trying to show "Out of stock" and disable a button for when none of the variants have stock, and unlimited stock is unchecked.
I've tried this, which isn't working:
{% if product....
3
votes
1
answer
1k
views
Structuring products variants
I'm in the process of setting up a shop with Craft Commerce but I'm having some trouble organising the data structure of the products. The problem is that some products have both sizing and color ...
3
votes
2
answers
611
views
Add custom fields to variant snapshot
How would I add more information (custom fields) to a variant's snapshot?
The custom field I'm adding will change over time, but I need it to stay consistent on invoices etc.
3
votes
3
answers
1k
views
Check if cart contains valid products for discount code
I am trying to setup some error trapping on the discount code to output an error message if there are no products that qualify for the discount code the user enters. Here is the code I have;
{% ...
3
votes
3
answers
1k
views
Option and notes fields after cart at checkout for order, not just line items
My client has gift wrapping services but they apply to the entire order, not one single line item.
How would I add notes or custom fields to the entire order, at the shipping stage of checkout? is ...
3
votes
1
answer
253
views
Set Entries field in Commerce order on completion
I'm trying to set an Entries field within a Commerce Order once the order completes.
I've tried using the onOrderComplete event like so;
craft()->on('commerce_orders.onOrderComplete',function($...
3
votes
2
answers
95
views
How do I query for all users that bought a license?
I’m trying to use Craft Commerce with the Digital Products plugin for a site where users can pay for being listed on that site.
Therefore I need to query for all users with certain criterias plus a ...
3
votes
3
answers
411
views
Duplicate an existing Order as a new Cart in Commerce
Orders can not be edited in Commerce. Makes sense.
What we want to do however is make it very easy for someone to re-order a previous order. So for example they've had an order that contains "two ...
3
votes
1
answer
818
views
Transaction Error Message in Template
When a payment is made and something is incorrect e.g. card number is invalid, expiry date is in the past etc. The form just refreshes with no warning / notification of what's happened.
I've noticed ...
3
votes
1
answer
762
views
Craft Commerce: Sub total before tax in cart?
I'm looking to get the sub total of all items in the car before and tax is added on. The example shop code doesn't seem to have this implemented. Is it possible to do?
Total Discount: {{ cart....
3
votes
1
answer
1k
views
Display custom product field in cart
How would I access a custom product field in the cart. I did it with the snapshot attribute like so:
{# cart.html #}
{% for item in cart.lineItems %}
{{ craft.commerce.products.id(item.snapshot....
3
votes
2
answers
1k
views
Have the country in craft.commerce.countriesList default
Is there a way I can have the array from craft.commerce.countriesList automatically default to the country my store is in?
3
votes
2
answers
403
views
How can I notify store owners when stock levels are getting low?
For a Craft Commerce site, the store owners wish to be notified automatically when a stock is starting to get low. Can this be achieved with a plugin, and if so, how?
3
votes
2
answers
831
views
Getting started with Order Adjuster plugin
Starting with the Business Logic plugin from https://github.com/lindseydiloreto/craft-businesslogic I'm following 3 for 2 etc with Craft Commerce to get started.
I have my main plugin file containing:...
3
votes
2
answers
1k
views
Register a user as part of a Commerce checkout?
Is it possible to register a user for a Craft user account as part of a Craft Commerce checkout flow? Ideally something where you can ask if the user wants to create an account and save their details ...
3
votes
1
answer
286
views
What is the correct syntax to check if a user has permission?
In my plugin, I am checking to see if the current logged in user has permission to save a commerce product.
$user = craft()->userSession->getUser();
if (craft()->userPermissions->...
3
votes
1
answer
517
views
How can I set a BOGOF (Buy One, Get One Free) promotion using Craft Commerce?
Under Commerce > Promotions there are the two options: Sales & Discounts. Sales is a flat rate with little conditions, so that leaves Discounts.
Discounts have a bit more flexibility, but only ...
3
votes
1
answer
767
views
Is it possible to separate variant options on a front end add to cart form?
Is it possible to have separate variant option fields on a front end add to cart form?
For example… have a separate select field for Color and a separate select field for Size?
3
votes
1
answer
322
views
Can notes on line items be updated on checkout?
Currently, a user has to click update on each line item to save changes to quantity or a note. The quantity might make sense to the user as it updates the price, but a user could assume that the note ...
3
votes
2
answers
619
views
I'm searching for a option to remove all unused images
I'm searching for a option to remove all unused images every minute.
The images I use are for Craft Commerce.