Questions tagged [plugin-craftcommerce]
Use this tag for questions relating to the Craft Commerce product.
834
questions
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 ...
1
vote
2
answers
500
views
How-to display a dropdown field with optgroups?
The display of a dropdown without optgroups is defined:
{% set field = craft.app.fields.getFieldByHandle('<FieldHandle>') %}
<select name="fields[<FieldHandle>]">
{% for option ...
1
vote
0
answers
30
views
EagerLoading on category pages with different product types
I have a category template like so;
{% extends '_layouts/_site' %}
{% set products = craft.products
.with( [
'department',
'productImage',
'finish',
'pcd',
'variants',
'thread',
'...
0
votes
2
answers
274
views
How to install plugin - Non-developer
I am not a developer and I hope someone can help me. I had purchased a Mailchimp Commerce plugin via the plugin store but I don't know how to install it or find any documents on how to.
I do see the ...
0
votes
0
answers
28
views
Getting Store Currencies Using Element API and Craft 3
How can I return the available store currencies using the Element API? I think it uses craft\commerce\Plugin::getInstance()->getCurrencies();but unsure how to go about creating an endpoint for ...
1
vote
1
answer
178
views
Craft 2 Commerce 1 cart session expiry
Is it possible to change the cookie timeout just for the cart? E.g. I'd like to clear abandoned carts after X hours and keep all the other sessions untouched (e.g. user sessions etc).
Please advise ...
1
vote
0
answers
124
views
Upsell/Cross-sell plugin on Craft Commerce
I am an end-user and I help run an e-commerce company. We are exploring Upsell/Cross-selling during checkout and I am not able to find a plug-in or documentation on how to implement it.
Has anyone ...
0
votes
0
answers
112
views
Setup different shipping costs per product category
I have multiple to products in two different categories; shirts and mugs. I want different shippings costs for these categories.
Currently I have a shipping method (default) which is (apparently) ...
1
vote
1
answer
79
views
Craft CMS Product Types
I am trying to setup some products in my test website. I am unsure how I should go about creating the products. Should each product category be created as a product type?
An example is, if I have ...
1
vote
1
answer
60
views
Show multiple products (urls/pages) on the front-end with dynamic titles/descriptions/meta based on a single product in Craft Commerce
I am considered the best way to set this up in Craft and how to handle this with front-end Urls, templates and routes?
So I products with variants for Wheel Spacers, (Wheel Spacers are a product type)...
2
votes
0
answers
100
views
Is it possible to pass metadata to Stripe from Craft Commerce
With Craft 3 and Craft Commerce 2 with the P&T Stripe gateway is it possible to pass metadata to Stripe? I've tried various combinations of hidden fields but without success so far.
I was hoping ...
2
votes
2
answers
415
views
Get last item added to cart
Does anyone know a nice way to get the last lineItem(s) added to a cart in craft commerce via twig template? Example use case, an 'added to cart' confirmation page. I know for this you could query ...
1
vote
0
answers
314
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
68
views
Query a subselection of Sales and Discounts
Imagine a less than perfect world, where a 'bundles' product type is just a new product with a sale/discount on it.
Would there be any way to query all sales and all products only related to these but ...
1
vote
1
answer
296
views
Searching for item SKU in Commerce orders
I'm trying to show some Commerce 2 order information on the front-end. I can't work out the correct syntax. I'm trying to list orders that include a specific product.
I have orders for item SKU "...
1
vote
1
answer
221
views
Asset Filename Query using Product SKU
I'm moving an e-commerce site over from EE. Many of the products have a "product image". Many do not, but we have an assets directory full of images that match their SKUs.
When listing the products ...
1
vote
1
answer
33
views
Commerce 'Edit Order' page taking 10 seconds or more to render
The individual order view in the CP is taking 10 seconds or more to be displayed, how can we avoid/debug this?
PS. Can ignore the errors in the log (I think) as they are just mmikkel\cpclearcache\{...
1
vote
2
answers
57
views
Issues with Craft Commerce [closed]
We have a dutch website build with Craft CMS and for the webshop Craft CMS Commerce. This has been done by a design company. We don't receive any orders and I am wondering if the whole process is okay....
2
votes
1
answer
166
views
Commerce 1: Different default order status based on product types
I want to assign different default order status based on product types. Is this possible?
What I need to achieve is to send different email notifications based on product types. Can this be ...
2
votes
1
answer
280
views
Get and display a product's variant fields in twig
I'm working on a product template that can display products of any type.
Various product types have varying numbers of variant fields each with their own options as other products. (All of my variant ...
1
vote
1
answer
154
views
Get a specific product with Element API, Commerce and Craft 2
How do I get a specific product via Element API?
Here's what i have so far
'api/product' => function() {
$productId = craft()->request->getRequiredQuery( 'productId' );
return [
...
2
votes
0
answers
200
views
Line item not found when trying to remove item from cart
I'm trying to remove a product from a cart but i'm getting an {error: "Line item not found"} error and I can't figure out why. Here is my code:
$('.js-item').on('click', function(e) {
e....
1
vote
0
answers
49
views
Is it possible to change the group that a user belongs in the front-end?
A little background:
The website runs on Craft v.3 Pro and Commerce v.2 Pro
The user can register as a member from the front-end.
They will be able to select only one of 3 different groups to ...
1
vote
1
answer
107
views
Custom Plugin for ZenDesk Tickets [closed]
I need all of the custom fields on an order submitted to ZenDesk to create a new ticket once the order is completed.
Once a ticket is created in ZenDesk, we will need the ticket number saved on a new ...
2
votes
0
answers
260
views
Creating multiple plan subscriptions
Versions:
- Craft CMS (3.1.21)
- Craft Commerce (2.1.2)
- Stripe for Craft Commerce (1.2.0)
Problem:
- My website offers user's ability to subscribe to several subscriptions at the same time. ...
1
vote
1
answer
34
views
Individual persistent property per item in stock
This is more advanced: We want to sell activation keys for digital products. We know that in Craft a variant has a stock. So every single item "in" the stock needs a unique activation key. When we ...
1
vote
1
answer
524
views
CDbTransaction is inactive and cannot perform commit or roll back operations
Folks:
I've been running this site for 2 years without issue but today, this cropped up:
"CDbTransaction is inactive and cannot perform commit or roll back operations."
This occurs when adding a ...
1
vote
1
answer
193
views
Clear template cache after update sale on Craft Commerce
How can I clear products template cache after update sale ?
Because product price don't change ...
Thank you.
1
vote
1
answer
168
views
How to display the featured image on a Commerce product:
How do I display the featured image on a Commerce product:
<figure>
<a href="{{ entry.url }}">
<img src="{{ entry.featuredImage[0].getUrl('medium') }}" alt="">
<...
1
vote
1
answer
4k
views
Unexpected token "name" of value "name" ("end of statement block" expected)
Internal Server Error
Unexpected token "name" of value "name" ("end of statement block" expected).
Getting this error on my commerce/products template. What am I missing?
{% extends 'shop/_layouts/...
1
vote
0
answers
27
views
Exclude User Group from Sale
Is there a way to exclude a User Group from a sale?
We have a trade user account that applies a flat 20% discount across all products but we're trying to run a different sale for all customers on a ...
2
votes
1
answer
683
views
Craft commerce and invoices
In general what is the best practice to handle invoices from orders made in Craft Commerce ?
1
vote
1
answer
894
views
Dynamically update line item in Commerce 2
I'm currently trying to adjust the line items in a particular cart/order after an event is triggered.
I've got:
use craft\commerce\Plugin as CommercePlugin;
$this->requirePostRequest();
$request ...
1
vote
1
answer
127
views
Donation Status Commerce 2
Currently trying to use the new Donations feature of Commerce 2 - https://docs.craftcms.com/commerce/v2/donations.html
The order goes through fine and I can see the donation purchasable in the order.
...
2
votes
1
answer
137
views
Craft Commerce 2 - extend Order details page
Let's say we're on the order details page with the 3 tabs - Order Details, Transactions, Status History
How do I add an extra tab with content?
Craft V3 / Commerce V2
Thanks
1
vote
1
answer
126
views
Add attachments with Craft Commerce
Suppose I have an assets field in my orders fields, how could I attach those files in the confirmation email?
1
vote
1
answer
74
views
Localization - "not found" in CP on language selection
Folks:
I'm creating a localized site on Craft2 and CraftCommerce. I have followed the instructions for creating a localized site but none of the content shows at the localized URL and the homepage ...
1
vote
1
answer
673
views
Get only enabled variants of a product
I would like to get all enabled variants for a product. I refer to the following question, where a method for limiting a for-loop is given:
Disabled product variant still shows in {% for %} loop
In ...
1
vote
1
answer
48
views
How to set Commerce 2 confirmation email in .env file?
We're just in the process of upgrading from Craft 2 with Commerce 1 to Craft 3 and Commerce 2. One of the issues we had before was that the client was getting confirmation emails for test orders.
Is ...
1
vote
1
answer
183
views
Commerce 1 create a new order programmatically
How can this be done in PHP? I can't find anything in the docs.
1
vote
2
answers
294
views
Commerce 1 get customer from user model
In PHP, is it possible to grab the customer model from a user model?
EDIT:
I just noticed that it is possible to attach a customer info field to the user. How do we achieve this?
1
vote
1
answer
340
views
Upgrading Commerce 1 to Commerce 2
Folks:
I've got an e-commerce site that I'm upgrading. I've upgraded to Craft 3 and can reach the CP and the home page.
This site is tightly integrated with Commerce 1. When I visit the plug-in page,...
2
votes
0
answers
109
views
Commerce 2 Subscriptions (Using Stripe API)
I'm currently trying to implement and understand how Subscriptions work on Commerce 2. I'm using Stripe API and have created the subscriptions on their CP. I've listed them on my shop page and added ...
2
votes
1
answer
524
views
Simple webshop solution (Craft Commerce)?
I am looking for a simple shopping solution for one of my customers. Since their website is already running with CraftCMS, I am looking if there is any integrated solution available.
However, so far ...
1
vote
1
answer
704
views
Craft Commerce multisite, different tax rates
In Craft 3, Commerce 2 is there a way to set a different tax category or rate on a cart/site when using commerce in a multi site environment? Site A (b2c website) has tax rate 1 (21% with tax included ...
1
vote
1
answer
526
views
Get all variants from multiple products
I need to get a list of variants from multiple products, but in a way that allows us to show the results in Craft's handy {% paginate %} tags.
So far we have this less-than-appealing markup:
{% set ...
2
votes
0
answers
252
views
Get field type of product or variant with element api
Trying to get type of a field (dropdown, checkbox, etc) to render those fields in app, there is all sorts of info available in $variant->fieldLayout->fields like handles, values, ids except type ...
1
vote
1
answer
39
views
How to get instance of DiscountModel in Commerce 2?
In Commerce i got an instance of DiscountModel Class as follows:
$discount = new Commerce_DiscountModel();
Is this the right way in Commerce 2?
use craft\commerce\models\Discount as DiscountModel;
....
1
vote
2
answers
556
views
Can I set a Commerce order custom field from a plugin
On a site with Commerce 1, I have set up some custom fields for order related data. I can set them using form inputs like so:
<input type="hidden" name="fields[myCustomField]" value="1">
I'd ...
0
votes
1
answer
129
views
Craft Commerce - empty cart.adjustments data
I'm having a Craft Commerce issue receiving cart.adjustments data in my twig templates. I've created a shipping category and shipping method with a rule to add a base rate of $10 to every order, but ...