Questions tagged [plugin-craftcommerce]
Use this tag for questions relating to the Craft Commerce product.
833
questions
1
vote
1
answer
58
views
Is there a way to control the order of appearance of shipping methods in Craft Commerce?
If there are multiple shipping methods available for an order, is there way to control the order in which they appear?
The CP doesn't seem to offer a way to re-order them. I'm using something like the ...
1
vote
1
answer
81
views
Adding an additional Download PDF to orders
Is there a hook or something I can use to add an additional Download PDF option to the Edit Order screen? It looks like a dropdown, but I can't find any docs on how to add to it.
1
vote
1
answer
185
views
How to search by title OR tag using Craft CMS?
I want to do a search query so the product title or product tag name matches the keyword. below is my code. if I remove the tag related query, this code works as it looks into the product title only ...
1
vote
1
answer
114
views
Make dimensions common for all variants in Craft Commerce
When I enable multiple variants for product type that has Dimensions and Weight, fields "Dimensions and Weight" become available for every single variant. Product is tablet and all variants ...
1
vote
1
answer
260
views
Missing field validation on user account edit
I've been implementing a user account page with Craft Commerce and copied over the template found here: https://docs.craftcms.com/v3/dev/examples/user-profile-form.html#simple-profile
The issue is ...
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 ...
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 ...
1
vote
2
answers
389
views
Commerce: Remove tax adjuster from line item in plugin
I need to remove adjusters from each line item if a certain condition is not met. I see that in the CP you can manually remove them by editing the line item but hunting down this code in Commerce's ...
1
vote
2
answers
294
views
How to show flash message for Commerce order when changing status on listing page?
If I change an order's status to "Cancelled" (my custom order status I created), I want to ensure that the CP editors provide a "Cancellation Reason" from a dropdown field in the order. I've set up a ...
1
vote
1
answer
30
views
passing product info to another product
We have a commerce site that provides samples of its items. We have a single product that handles all the samples and displays them in a dropdown. What I'd like to do is have a link on the product ...
1
vote
1
answer
56
views
Commerce custom field output
I have a custom field that allows customers to order a sample from a list of all products. It also allows a custom value to be entered for a custom color. I conditionally show/hide the fields with ...
1
vote
1
answer
248
views
Get all orders which contains a certain product type
In want to print a list of orders:
{% set orders = craft.orders.completed(true).limit(null).all() %}
Now I want to make a list of orders with only the product.type XYZ.
I tried to fabricate ...
1
vote
1
answer
43
views
Passing variant info
We have products with multiple variants (varHeight). The variant information get passed to the cart successfully and order emails. However, they don't show up on the control panel. How can I get the ...
1
vote
1
answer
33
views
Can you run two different Stripe accounts as two different gateways in Craft Commerce?
Does anyone know if there are any drawbacks/gotchas to having multiple Stripe gateways setup in commerce for Craft Subs?
If I wanted to have two sites on my craft install and for them to both use ...
0
votes
0
answers
55
views
Commerce product slug creates duplicates - can they also be autogenerated?
The slug for products is generated from the Title, for example in my case "Green Shirt". Seems like these are not unique, and if I create a product later on, also called "Green Shirt", they both get "...
2
votes
1
answer
234
views
Friendly order number - start sequence at specific number
Folks:
I'm having trouble getting my head around friendly order numbers and sequencing. The client has asked for his sequence to start at 11 000.
I can set up a sequence that starts at 1 based on ...
1
vote
1
answer
153
views
Environmental variables for Scout plugin in scout.php file
I was wondering if it was possible to add .env variable for the indices area in the scout.php file?
I added this to my .env file
SCOUT_INDICES = "search_SCOUT_DEV"
Then this to my scout.php
\rias\...
1
vote
1
answer
263
views
Update Cart’s address ID from plugin
I want to try and stop Commerce 3 creating a new customer address if it’s a duplicate of an existing one.
As an example, a store selling digital products has a checkout form that simply asks for the ...
2
votes
1
answer
153
views
Show only products in stock - one variant only
In Craft Commerce, how can I show only products that are in stock when not using variants?
For example, this query, but only show products with a stock with 1 or more:
{% set productQuery = craft....
0
votes
0
answers
71
views
Deleting primary commerce address throws error
When i try to delete a user address in Craft Commerce, I get an error thrown, saying the address id does not exist.
However the address id being passed to the action is output from a loop of the ...
1
vote
1
answer
126
views
Show custom fields on cart
I'm trying to show custom fields on the cart but I'm missing something (and new to Commerce, so bear with me). When I output {% for lineItem in cart.lineItems %} within my {% for item in cart....
1
vote
1
answer
71
views
product types with and without variants
I have two product types. One has variants. One has not.
So I try to write an image tag that works for both.
{% set imageThumb = item.defaultVariant.variantThumb.one() %}
For the product with one ...
1
vote
1
answer
296
views
Feed Me - importing Commerce variants from Google Sheets?
Is there a way to automagically create variants from a Google Sheet when importing via Feed Me?
The docs at https://docs.craftcms.com/feed-me/v4/guides/importing-commerce-variants.html#setup-your-...
1
vote
1
answer
76
views
Passing variants to cart in Commerce
I'm trying to pass variants to the cart page. They variant field I want to pass is 'varHeight'. I'm using:
<form method="POST">
<input type="hidden" name="action" value="commerce/cart/...
3
votes
1
answer
152
views
Is it possible to provide an option to pick up an order from the physical store in Craft Commerce?
We're setting up a Craft Commerce site and the merchant wants to give the option to the customer to pickup the order from their physical store instead of shipping it to a specified address.
If the ...
1
vote
1
answer
82
views
Is there a way to re-order states in Craft Commerce?
I'm setting up a Craft Commerce site and for some of the countries the user must specify a State. However, the order of states appears to be alphabetical.
The problem is that the site's traffic ...
1
vote
1
answer
118
views
Send payment requests
Is there a plugin/solution or something else in Craft so that I can basically:
1) Create a payment request in the CP and send it to a specified email?
2) The email contains a link to a payment form ...
1
vote
0
answers
28
views
How to apply sales to custom order adjustment?
Is it possible to apply a discount voucher to custom order adjustments? EG i want 5% off everything. I have two order adjustments, one is rush delivery and the other is an engraving fee.
At the ...
1
vote
2
answers
318
views
Commerce 1 with Apple Pay, is it possible?
We are using Stripe on our website. Craft CMS 2.6.2997 and Commerce 1.2.1351. Can we use the apple pay function?
I read the Stripe document(https://stripe.com/docs/stripe-js/elements/payment-request-...
1
vote
1
answer
30
views
Commerce 3 upgrade question
We're about to launch a Craft Commerce 2 site. I'm wondering how involved the Commerce 3 upgrade is as far as template changes? And if we decide to upgrade now what's the best practice for making ...
1
vote
1
answer
153
views
Server-side address validation in Craft Commerce 3
Was wondering how to do this in Commerce 3 as there were a few different older methods discussed here.
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.
1
vote
2
answers
99
views
Change naming of sections in Craft Commerce CMS
Is it possible to change the name of the of 'Products' to 'Projects' & Variants to 'Pledges'? I would like to use the Commerce CMS as a base to start from but need to be able to change certain ...
1
vote
0
answers
97
views
Is any way to add translations for Braintree Gateway dropin interface?
The correct way to add translation to an instance of braintree.dropin is to add options.translations array when calling the braintree.dropin.create method, for example:
if ($dropinUi.data('locale') =...
1
vote
1
answer
192
views
Applying coupon codes via URL
I was wondering if it was possible to allow a customer to apply a coupon code using a URL or URL params in Commerce 2. I haven’t been able to find any questions on stack exchange or on the web, but ...
1
vote
1
answer
121
views
Let admin create price offers/quotes for customers in Commerce
Does anyone know of a plugin (or coming functionality in Commerce 3 or 4) that allows admin to create price offers/quotes for a customer and then send it to the customer's email for review?
Scenario
I ...
1
vote
1
answer
107
views
Set base 'shop' URL to something else in Commerce
I am completely new to Craft and to be honest, really struggling to get my head around how it all works at the moment.
I've got loads of, what I feel, is quite basic questions that should be ...
1
vote
1
answer
154
views
disable guest accounts for commerce
Is there a method to remove the ability for commerce to allow guest accounts? I want to allow only registered, logged-in users to be able to place orders.
0
votes
1
answer
64
views
Invalidate cache on new order
I have a list of orders from Commerce 1 (Craft 2) in the frontend.
I want to invalidate the cache when a new order is placed but it doesn't work:
{% set latestOrder = craft.commerce.orders.first() %}...
1
vote
1
answer
89
views
How to toggle main product image from multiple images
I'm having some trouble figuring out how to properly update the main product image from a set of images that are available.
Within the product detail page, I have a large default image that is shown ...
1
vote
1
answer
63
views
Having issues looping through variants for Commerce 2 Products using Element API
I'm currently able to return the first variant using the following:
<?php
use craft\commerce\elements\Product;
use craft\helpers\UrlHelper;
return [
'endpoints' => [
'products.json' =>...
2
votes
0
answers
29
views
Prevent Shipping from being discounted
Is it possible to prevent a coupon code from also discounting the shipping costs associated with an order? We've run into a situation where a customer cart totaled $0 after they used a coupon code we ...
2
votes
0
answers
34
views
Is it possible to set up Amazon's "Subscribe and Save" type feature for Craft Commerce
I'd like to allow customers to be able to automatically set up recurring purchases at a discounted price, much like Amazon's Subscribe and Save.
I had originally skimmed through the subscription ...
0
votes
1
answer
463
views
Stock Levels for Commerce 2
I am putting together a proposal for an eCommerce site - one of the (obvious) requirements is inventory management. I do not see anything specific in the Commerce 2 docs. Basically, want to enter ...
1
vote
1
answer
46
views
Is it worth caching product blocks for use on a category page?
So we have a Commerce project that shows lots of products per page/category as per any standard store.
Each product block comprises:
Product name
Product price
Brand (via category field) [eager ...
1
vote
1
answer
255
views
Embedding a podcast player onto my Craft site
I'm pasting the embed code below into the HTML section but the player is not appearing. I do not have access to templates on my site. Is there a quick fix to get this to work?
I tried adding a plug ...
1
vote
1
answer
124
views
PayPal Pro In Craft Commerce
I am trying to integrate PayPal Pro into Craft Commerce, I have my API details added to the payment gateway and I have disabled test mode. I know these keys work as they have been used before.
On ...
1
vote
1
answer
151
views
Craft Commerce 1 - Stripe payment intents SCA ready
I am using Craft CMS 2 with Commerce 1.
I want to update to the new SCA ready (3d secure) Stripe integration.
Has anyone made this already?
1
vote
1
answer
89
views
Craft Commerce: fixed product variants/multiplier
We have a client that is selling products with fixed rate variants. In other words so that the base cost is the only price defined whilst others are based on a globally defined multiplier, eg. 1.5x or ...
1
vote
1
answer
138
views
Craft 3 / Commerce 2 + Multisite & COMMERCE_PAYMENT_CURRENCY
I've just done a Craft 2 > Craft 3 upgrade, and it previously used different locales to change the default currency, depending on the locale.
In Craft 2, I would set COMMERCE_PAYMENT_CURRENCY in my ...