Questions tagged [plugin-craftcommerce]
Use this tag for questions relating to the Craft Commerce product.
53
questions
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 ...
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 = {};
...
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:...
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 ...
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....
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:...
2
votes
2
answers
602
views
Overriding BaseFrontEndController in Craft Commerce
Is there a clean way to alter the cartArray that is returned when updating the cart through ajax? Which is defined in the BaseFrontEndController Craft Commerce.
For example by using a module? In this ...
2
votes
1
answer
147
views
Error on functions in queue: "Session does not exist in a console request."
I get the following error on multiple order mails from Craft Commerce. The error points out to the lines where a macro is called:
Email template parse error for email “New order”. Order: “e35f244”. ...
1
vote
1
answer
569
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 ...
1
vote
2
answers
1k
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 ...
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 ...
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 ...
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
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 ...
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
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
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 ...
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
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
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
1
answer
490
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 ...
3
votes
1
answer
969
views
Multiple Prices based on User in Craft Commerce
This is my first time using Craft Commerce. I have a client which needs to have multiple prices for a product. Customers are in one of three price level groups. Each price level group has a price ...
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
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
918
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 ...
3
votes
1
answer
2k
views
Craft Commerce: Product Options
I'm trying to get my head round how Craft Commerce manages product options. My Product has the following (multiple) options.
Material Type
Distance between design
No. of designs per metre
No. of ...
3
votes
2
answers
742
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
0
answers
256
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 ...
2
votes
1
answer
443
views
Disabled product variant still shows in {% for %} loop
Disabling a product variant doesn't remove it from a {% for purchasable in product.variants %} loop I have set up. It still renders an image associated with it, as well as a color swatch. Essentially ...
2
votes
1
answer
1k
views
Craft Commerce: Hard code different product prices based on currency?
We are considering using Commerce for a site where the company sets hard coded prices for the various regions and countries they sell in. I know Commerce has multi-currency support but pricing is in a ...
2
votes
2
answers
205
views
Get order shipping address in module
I'm trying to add an address column to my orders index but I'm having trouble correctly getting the actual address.
From my code below, when I dump on $orderShippingAddress I get the ID of a valid ...
2
votes
1
answer
610
views
Commerce: what is the purpose of a line item's snapshot?
Having nearly completed my first real Commerce project, I managed to utilize most of the features offered in Commerce 3. However, I never quite figured out what the use of a line item's snapshot is ...
2
votes
1
answer
1k
views
Craft Commerce Categories and Product Types
I've just started using craft Commerce. What's the accepted way to categorise products? For example, i’m trying to replicate this structure:
Bags and Scarves (shows all products in this category)
...
2
votes
2
answers
2k
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 ...
1
vote
2
answers
218
views
Commerce 2 Subscription Prices
We've currently got Subscriptions setup on a site which works a charm, but my main issue is outputting the price of the subscription, after the user has subscribed.
From the docs/templates I can even ...
1
vote
1
answer
195
views
Error on functions in queue: “Session does not exist in a console request.”
I already experienced this same problem with Craft Commerce a while ago (Error on functions in queue: "Session does not exist in a console request.") and got a solution that solved the ...
1
vote
0
answers
313
views
Is it possible to take a partial payment of an order in Craft Commerce?
I have a request from a client to be able to take deposits for events purchased through craft commerce. These are high ticket items and customers would like to spread the cost of payment over several ...
1
vote
1
answer
849
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
1
answer
1k
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 --#}...
1
vote
1
answer
854
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
2
answers
1k
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
2
answers
655
views
Is it possible to subscribe a user to Mailchimp during checkout in Craft Commerce?
Our checkout is only for registered users.
Ideally you'd just provide a checkbox that says: Subscribe to Mailchimp?
Any ideas?
1
vote
3
answers
798
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
2
answers
507
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
1
answer
454
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
3
answers
577
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
0
answers
126
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
1
answer
371
views
Product price format in euro
I have a Craft/Commerce set up with Euro is base (and only) currency and 3 locales are defined in the site (nl_be, fr_be and en_be).
Prices are showing up as:
0,99 €
instead of
€0,99
When I ...
1
vote
1
answer
328
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 ...
1
vote
1
answer
468
views
Per item ie gift wrapped with additional cost in Craft Commerce?
How can we do fields linked to products that the user can personalises when buying that product, ie writes in a custom gift message and picks an option of gif wrapped with additional cost.
Our client ...