The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [plugin-craftcommerce2]

Questions related to the Craft Commerce v2 plugin.

Filter by
Sorted by
Tagged with
1
vote
0answers
14 views

How can I show only the sale discount applied to a completed order

I have two orders for the same product. One placed with a sale on the product enabled and the other with the same sale on the product disabled. On the order details template for customers I have the ...
0
votes
0answers
7 views

Commerce preferred currency - user/customer setting

Is there a way for users/customers to set a custom/preferred currency that would be applied to any future carts (assuming more than one currency was available)? Was looking at whether could do this ...
1
vote
0answers
15 views

EVENT_AFTER_CREATE_SUBSCRIPTION can someone confirm this means successful purchase?

Regarding Event: EVENT_AFTER_CREATE_SUBSCRIPTION https://docs.craftcms.com/commerce/api/v2/craft-commerce-services-subscriptions.html#events The document states "The event that is triggered after a ...
0
votes
0answers
13 views

Payment currency not allowed

Craft 3.3.8 Commerce 2 Lite Version If I change the base currency from default(USD) to NZD or AU in the setting CP > Commerce > Store Settings > Payment Currencies and browse to /shop/ or ...
1
vote
1answer
15 views

Craft Commerce: discount taxation

Is there a way in Craft Commerce to apply discounts to the net order total (eg the subtotal/before tax is applied to the order)? Out of the box this seems to discount from the basket/order total.
1
vote
0answers
17 views

Getting value from response (Craft Commerce)

I'm in the process of adapting the old RealEx gateway to work in Commerce 2 since that's what we're using and there isn't native support in V2. I've got payments and 3D secure working, now I'm trying ...
0
votes
1answer
20 views

Is it possible to add to cart with a radio input rather than a select?

I'd like to add a digital product to the cart using a radio input but all the template examples I see use select. Is it possible to use a radio input? With Select (working): <select name="...
0
votes
0answers
18 views

Recommended way to organize product types and fields in Craft Commerce

I am setting up a Craft CMS site with Craft Commerce for a B2B-customer. Here is a little excerpt of their product type hierarchy: Textile Sewing machines Heavy Duty Machines Furniture machines ...
1
vote
1answer
21 views

Can I call a dynamically named variable through twig?

I am using Craft 3 with the Commerce 2 plugin. I am trying to dynamically call a variable in a twig template where this variable has to be a "placeholder" for a handle of a field inside a block ...
1
vote
0answers
20 views

Order history access item/cart totals in payment currency

I'm a bit confused at how to show previous orders taken in another currency. For example, if I take a payment in EUR but my default currency is GBP the order price (eg subtotal, tax, total, etc) are ...
0
votes
0answers
18 views

Craft Commerce 2 order payment debugging

The payment form works fine with a dummy gateway, but when I switch to the Mollie payment gateway (live key) the payment form just refreshes the page. The error flash is "Invalid payment or order. ...
0
votes
0answers
13 views

Worldpay integration: Craft Commerce

Am testing a sample checkout page in Craft Commerce 2 with Worldpay. The JS iframe is loading into the page fine and when I enter sample card details I can see in the browser inspector that when I ...
1
vote
1answer
21 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
1answer
24 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 ...
0
votes
0answers
5 views

Regenerate SKUs for specific product types when using auto-generated SKU's

As the title say's really. Is there a way I can regenerate a load of SKUs for a certain product type based on some changes I have applied to the auto-generated SKU settings? Thanks.
1
vote
0answers
40 views

Craft Commerce Adjuster API/PHP questions

I've got a module set up to add discounts based on criteria defined in a category group (handle 'productPacks') -> category (which is a "pack"). Now, everything works great for one type of pack, and ...
0
votes
1answer
57 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
0answers
16 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
0answers
44 views

Payment gateways are not synced

Craft Solo : 3.1.25 Craft Commerce : Lite (2.1.12.1) I am trying to integrate it with Commerce Lite for a subscription plan. I Created 1 product at stripe account. Added stripe keys to my local ...
0
votes
0answers
13 views

Updating a `purchasableId` on an existing `lineItem` in Craft Commerce

The design for our cart is such that there are lines items listed in the UI which represent a product each. For each of those there is a drop-down selector which allows the user to change the variant ...
1
vote
1answer
34 views

How can I change variant price in Craft Commerce 2 form

I want to add range field that will change price based on its value. How can I send updated price to the cart? Is there something easy like: {% set product = craft.products.one() %} {% set variant = ...
0
votes
0answers
19 views

Manual Gateway broken in update?

I've updated to Craft CMS 3.2.9 and Commerce 2.1.10 and now my Manual Gateway form does not work anymore. These forms worked fine before I updated. What changed and what am I missing? My template for ...
1
vote
1answer
18 views

Commerce 2 Adding tax to custom adjuster

I have created a custom adjuster, there is a surcharge per item if a customer has selected rush delivery. But i need to charge tax on that adjuster. Below is code: public function adjust(Order $order)...
1
vote
1answer
20 views

Craft Commerce 2, turning on debug bar and getting error

Craft Commerce 2, turning on debug bar and getting an error. "Invalid Configuration, Payment currency not allowed." Could anyone shed any light of this error please?
1
vote
1answer
11 views

Supersort - Sort multiple variables together

I'm trying to sort my commerce orders by 2 variables, one being in the order loop, and the second being within the lineitems. I want to order by the lineitem variable first, and THEN the order ...
1
vote
1answer
18 views

Craft Commerce product item price showing incorrect

If I use the following format to show an item price: .defaultVariant.salePrice|currency('GBP') or .defaultVariant.salePrice|commerceCurrency(cart.currency) the website is returns as: 9,99 £ ...
1
vote
1answer
13 views

How can I set the isCompleted status of an order from within a custom module?

The default behaviour for commerce is to mark the isCompleted flag on an order to true once the order has been paid for. I have need to alter this behaviour and only want to mark an order as Complete ...
1
vote
1answer
30 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)...
1
vote
0answers
17 views

Craft Commerce: Create new shipping zone by excluding other zones

I need to create 3 shipping zones in Craft Commerce 2 (currently on v2.1.7): UK Europe Rest Of The World Having to manually add the countries to the UK and Europe zones isn't too much of an issue, ...
0
votes
0answers
24 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 ...
1
vote
1answer
45 views

Commerce 2: Custom product fields not showing up in order

I've created a dropdown field for my users to select from on each of my products, but if the user was to select an option from the dropdown and click 'add to cart' , it doesn't show up in their order ...
1
vote
1answer
27 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 ...
0
votes
0answers
24 views

Implementing Mollie Payment Gateway

I'm having a bit of trouble with the Mollie Payment Gateway and how it works, the docs are a bit...short. I know that Mollie is an off-site payment gateway, with that I have a few questions: I've ...
1
vote
0answers
15 views

Adding Product Variant and Related Product to the cart together on Craft Commerce 2

I want to add a product variant as well as a related product (chosen from a select list) together when the user clicks the add to cart button. I can see you can add multiple products together with ...
1
vote
0answers
40 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
1answer
16 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 ...
0
votes
1answer
21 views

Adding more data to the “commerce/cart/update-cart” action [duplicate]

Is it possible to add additional data to the "commerce/cart/update-cart" callback? For instance, we want to include an Asset field so we can populate a cart modal with the item's image in one call? ...
1
vote
1answer
46 views

Delete commerce line item with Ajax

I am attempting to delete a commerce line item with ajax request but nothing ever deletes. Am i doing something wrong? Vue function below: removeLine(id) { axios.post('', { ...
2
votes
1answer
30 views

Is there a way to see a fields variant relation in templates?

To clarify; if I have a disabled variant, and I'm looping through categories (colors) on each product like {% for variantColor in variantColors %}...{% endfor %} which makes it still show up in the ...
2
votes
1answer
103 views

Customizing Stripe payment form for Craft Commerce 2 subscription

Where does one start with matching the style of the Stripe payment form to the rest of the site? Using Stripe for Craft Commerce Plug-In {{ plan.getGateway().getPaymentFormHtml({})|raw }} This ...
0
votes
0answers
21 views

Batch update/edit Commerce product slugs to match their SKU?

Our client has entered hundreds of products from their catalogue, but their autogenerated slugs are inconsistent with their SKUs. Eg in the screenshot below, the first 3 products have correctly ...
1
vote
1answer
15 views

How to display Craft Commerce subscription description from a linked entry

I must be missing something obvious here but I don't see any reference to this in the docs. Under Commerce Settings > Subscription plans > You can link a related entry to the Description but it is ...
1
vote
1answer
35 views

Filter and sort Commerce products based on Matrix blocks

We have a website that uses Craft CMS v3.1.28 and Commerce v2.1.6.1. The below logic is implemented within a plugin and we're prepared to do custom implementations aka. prepared to go deep! I would ...
1
vote
1answer
82 views

Is there any plugin for Blog in Craft 3?

I want to create a Blog website in craft cms. I would like to know, is there any plugin for Blog which we can use in Craft similar kind of WordPress?
1
vote
1answer
27 views

Merge trashed element with existing one

Is there any way to merge trashed elements with an existing element? I'm creating a custom restore action so you can merge a trashed (commerce) Product with an existing one. The mergeElementsByIds ...
1
vote
1answer
29 views

Craft Commerce Order Notifications from customer email and name

Quite a specific question from a client on another e-commerce system who would maybe like to move to Craft Commerce. I have used Craft for a few client sites now but not Commerce as of yet. Basically,...
0
votes
0answers
18 views

How do I call complete a purchase

I am trying to implement a 3D secure payment gateway and I am having a trouble completing the purchase. I am debugging it but the CompletePurchaseRequest is never called. Here is my PurchaseRequest ...
0
votes
0answers
20 views

How to set action url and inputs for redirect template

How do I set the actionUrl and inputs variables values in the redirect template for payment ? of the gatewayPostRedirectTemplate config.
2
votes
2answers
118 views

Getting started with Craft Commerce 2 subscriptions using Stripe

I’m new to Craft Commerce and am really having trouble getting started with subscriptions. I used the example from the docs and nothing happened. When reloading the cp though, it kept telling me "...
1
vote
1answer
19 views

Cart - only one item at a time

In my cart on Commerce, I only get to have one item at a time. If I try to add another item, it replaces the item that was already in the cart. I have used {% set cart = craft.commerce.getCart() %} ...