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.

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
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:...
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....
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 = {}; ...
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 ...
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:...
1
vote
2answers
851 views

How do I select a specific product variant by element/field/entry?

Excuse my new-ness, but I'm having an issue with product variants. Scenario I have a product with multiple variants (up to 30 in fact). Based on the URL, I want to choose a specific variant so that ...
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?
1
vote
1answer
292 views

Getting to grips with errors and flash messages

As a newbie to Craft and Craft Commerce. I wondered if someone could explain the difference between all these error codes that I have seen either in the docs, this forum or the templates and when they ...
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 ...
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
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 ...
3
votes
2answers
635 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
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; {% ...
2
votes
1answer
253 views

How to apply a discount or sale to a variant?

The sale and discount menus only discount at the product level. However, I need the ability to apply discounts and sales at the variant level. How would I do this? Example: I sell a piece of software ...
1
vote
2answers
272 views

How can I update a custom Order field in a plugin controller?

I have a custom plugin in which I have a controller action which I want to validate some values and then update a custom field on the Cart. I can get the values from the form and validate them, I'm ...
1
vote
2answers
374 views

Craft Commerce - Edit Complete Order Address from frontend

We are trying to give our clients the ability to update an order's shipping address before the order has been actually shipped. We've created a members area where they can list their orders and ...
1
vote
1answer
798 views

Search Form with Craft Commerce

I am using the following form in Craft <div class="parts-search"> <form class="parts-search-block" action="{{ url('parts/results') }}" method="get"> {#-- CATEGORY SEARCH --#}...
0
votes
1answer
834 views

How can I get/check the contents of a cart via javascript (cookie)?

Within my application, I would like to only show a link to the the user's cart only if there are products in it. I was going to use javascript to check the cookie I can see getting set. ...
0
votes
1answer
59 views

Save and show card fee for Commerce plugin

How do I save and show the credit card fee on the order page. When I get the response from the gateway I too get the credit card fee amount but it's not being added to the order and isn't viewable ...
3
votes
1answer
274 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 ...
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.
2
votes
2answers
775 views

Craft Commerce: Calculating (Product + Shipping) + Tax?

There is an option when setting up Tax Rates to apply the tax to "both (item + shipping costs)" however when testing on the front end the shipping cost is added after tax is applied to the product and ...
2
votes
1answer
397 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....
2
votes
1answer
140 views

Changing the order of address fields

I am trying to order the address fields so that they read Business name First name Last name Company name Address 1 Address 2 City State Zip Phone I moved some of the items around in the ...
1
vote
0answers
125 views

Craft Commerce: send notification emails when setting status dynamically?

How would I get a status notification to send when setting the status of an order dynamically via a plugin? I've got a few different order 'types' that need a different default status (for different ...
1
vote
3answers
357 views

How can I display the Discount Value onSale of Products

I am trying to display the Discount Value (%) of Products with the onSale Tag. What works for now is to display only the Products which are onSale. But I can't figure out which value stores the ...
1
vote
1answer
293 views

Craft Commerce - For a discount, can we include all products in the product count but not include the sale items that receive the discount?

What I would like is for a 10% discount to be applied to non sale items after the total cart quantity reaches 10 total items. I would ONLY like this discount on non sale items. Is that possible? So, ...
1
vote
2answers
307 views

Craft Commerce: Upload File Field in Order?

I'm looking at Craft Commerce as a possible solution. In the order process we want customers to be able to upload a file against their order which can then be accessed by the shop administrators. Is ...
1
vote
1answer
315 views

Handoff to Paypal Express with Craft Commerce

I'm running into issues handing off a cart transaction to Paypal Express. I've set the paymentMethodId correctly on the cart, but when I submit to commerce/payments/pay I am only getting redirected to ...
1
vote
1answer
430 views

How can I filter Craft Commerce products by price

I'm trying to use price as a parameter for filtering my Craft Commerce products, but I cannot get it to work. I think the problem is with the way that I'm referring to the product price, but at the ...
1
vote
0answers
79 views

Commerce products returning different results on page load

I have a great many products which have a date field (they're class dates) and I want to show the next three which have any stock left (available places). The following works fine to display the next ...
1
vote
1answer
144 views

Get the category into the url of the product page

I'm in the middle of learning Craft Commerce. When I go to an individual product my URL says /shop/wella-shampoo/. I'd like it to say /shop/**hair-care**/wella-shampoo/ because this is the category ...
0
votes
1answer
252 views

Display image asset of a variant

Craft Commerce newbie question.... How do I display the image asset for a custom variant field? I'd like to display the associated image of a product variant in the cart.