Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [plugin-craftcommerce]

Use this tag for questions relating to the Craft Commerce product.

12
votes
0answers
534 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 ...
10
votes
2answers
704 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 ...
10
votes
1answer
208 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 -- ...
9
votes
1answer
358 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 ...
7
votes
2answers
2k 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 ...
7
votes
2answers
200 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?
7
votes
1answer
889 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 ...
6
votes
2answers
509 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: ...
6
votes
2answers
142 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 ...
6
votes
2answers
730 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 ...
5
votes
1answer
358 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
1answer
1k 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
1answer
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
1answer
173 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 ...
5
votes
1answer
612 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
1answer
174 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?
5
votes
1answer
763 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
2answers
346 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
3answers
921 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
1answer
945 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
3answers
173 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 ...
4
votes
1answer
730 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 ...
4
votes
2answers
184 views

Get 'purchasable' from ElementAPI

The elementApi docs state you can use custom elementTypes via plugins. I am using craft commerce which states it creates the custom elementType 'purchasable' I've tried: return [ 'endpoints' => [...
4
votes
2answers
344 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)?
4
votes
1answer
445 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?
4
votes
1answer
221 views

Apply shipping without the shipping screen

Folks: All the products in the store I am working have only one shipping method (ground). It seems redundant to have people go through the shipping screen since there is only one shipping option. Is ...
4
votes
1answer
602 views

Are categories the best way to organize Commerce product filters?

The Commerce site I'm working on (my first Craft project) will have a product listing page with filters. These will function as you would expect, but clicking a filter name will link to another ...
4
votes
1answer
442 views

How can I create a States drop down?

Working with the Commerce example templates. The example template uses javascript to populate the States which is based on the selected Country. The code for the Country and State select field: <...
4
votes
1answer
102 views

What's the correct way to relate element types to a custom element type?

I'm working on a custom stock management plugin for a client's Craft Commerce site, and I need to have relations from my custom element type (used to keep a detailed log of stock changes) to the ...
4
votes
1answer
88 views

Commerce - How do I add the purchaser of a specific product to a user group?

I want all buyers of a specific product to automatically be added to a specific user group. How do I do this?
4
votes
1answer
532 views

Create an alternate Stripe Payment Method

Instead of taking payment via the Omnipay/Stripe Payment Method, what I'm trying to do is just create a new Customer and Credit Card on Stripe during Checkout, no payment taken at all at this stage. ...
3
votes
1answer
173 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
2answers
154 views

How to use better loop for my product images

I have a main product image and 4 thumbnails. Main product image is a lightswitch which is named productMainImage. Here below i first iterate for the main image (which lightswitch is on) and than i ...
3
votes
2answers
69 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
2answers
294 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
2answers
292 views

Filter order by order status

I am creating a custom dashboard for delivery guys where I want to show the order list in two divs. One is Pending Orders and second is History. Basically I want to filter my order list by order ...
3
votes
2answers
699 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
2answers
299 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
3answers
164 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
1answer
105 views

List Orders with datePaid is within last 14 days using the Element API plugin

I want to list the orders with datePaid is within last 14 days. But I cannot workout the correct criteria, and I don't know if isPaid works correctly as well: 'criteria' => [ 'dateUpdated' =&...
3
votes
2answers
523 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
1answer
93 views

Unable to store Model in Commerce Order Fields

I'm trying to use custom order fields in Craft Commerce to store a reference to an object, but all I am getting back is an ElementCriteria model. I have two custom order fields defined: twoDayOption ...
3
votes
1answer
216 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
1answer
238 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
2answers
436 views

How to attach an order PDF in an order confirmation email?

I am currently adding a link to download the order PDF in the confirmation email with {{ order.getPdfUrl() }} but also want this to be an attachment.
3
votes
1answer
259 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
1answer
119 views

Commerce: How to implement/save 'Use shipping for billing' field for future orders

There is a 'Use shipping for billing' field in the Craft Commerce sample templates but it is unclear to me how to use that in the CP or for an account user in their account or for a future checkout. ...
3
votes
2answers
454 views

Get sale price in Commerce

How does one get the sale price of a product in Craft Commerce on a product page? I'm new to Craft and Twig and the sale section of the Commerce docs is.. well, not really there (page under ...
3
votes
2answers
62 views

In Commerce, can I apply a discount only on a specific number of one product?

I know that I can apply a discount if a specific number of products is ordered. I could also add a discount for a specific product, with a specific amount. But, am I able to create a discount with ...
3
votes
1answer
68 views

How can I relate a FK back to the purchasable ID?

First off, HUGE thank you to Lindsey for opening this door for me. Opened up a whole new layer! I have (another) plugin that is listening to the commerce_orders.onOrderComplete event. My plugin ...