Questions tagged [plugin-craftcommerce2]

Questions related to the Craft Commerce v2 plugin.

Filter by
Sorted by
Tagged with
0
votes
0answers
7 views

How do I pass custom field contents from cart to order

cart.billingAddress and cart.shippingAddress are both are set to the same address and include custom1 and custom2 fields. After submitting the order, order.shippingAddress and order.billingAddress ...
1
vote
1answer
20 views

Get products that are in stock

In Craft Commerce 2, how can I query products that are in stock? These are products without variants. Edit: Perhaps this is a Craft-bug? This particular product type used to support variants - but ...
1
vote
0answers
26 views

Customize Stripe payment intent forms when using Stripe for Craft Commerce (commerce-stripe) plugin [duplicate]

Is it possible to style the fields contained in the Stripe Intents form when using this plugin? Currently the form seems to load with all the interactions but with minimal styling. I'd like to have ...
0
votes
0answers
10 views

Cart total before shipping and tax (but with discounts)?

Wanting to check this out but it appears that there is no property or method to get a total of all lineItems in a cart plus any discounts (so without any tax or shipping (ie. other adjustments)). It ...
0
votes
0answers
19 views

How to do smart upselling and cross-selling in Craft Commerce

I want to have the following features on my Craft Commerce site: Often bought together: Bundling You may also like: Upselling/cross-selling/personal recommendations Accessories I realize that it's ...
1
vote
1answer
8 views

Craft Commerce > 2.2: How can you order line items?

As of Commerce 2.2 line items are ordered by date created. How can you order line items differently? {% for item in cart.lineItems.orderBy(’sku desc') %} does not work…
0
votes
0answers
10 views

Set the redirect url for a request from a plugin

I implemented an API for my Craft 2 site, One of the requests requires me to open a webview where the user can fill in some forms. What happens is that he enters some info from the app that will be ...
0
votes
0answers
18 views

Commerce payment currencies

admin/commerce/store-settings/paymentcurrencies There is no Croatia on currency list HRK How to solve that... Is it possible (in Craft Commerce V2) to have multi STOCK location fields for products ...
0
votes
1answer
27 views

How to identify the recurring payments that happen after the initial subs creation payment the in Commerce Subs

I've got a custom module that I have written to inject data into various places in my site when events happen with Commerce Subs. As per the question title, I need to update an entry when a recurring ...
1
vote
1answer
17 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
1answer
21 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' =>...
0
votes
0answers
10 views

How do I apply taxes to subscriptions with Stripe plugin?

I need to apply taxes to subscriptions. How do I do that? The idea is that prices are first shown without taxes. Then – on the payment page – I need some kind of "bill" that shows all the relevant ...
0
votes
0answers
12 views

How-to display a specifc optgroup from a field

based on "how-to display a dropdown field wth optgroups", I would like to display only labels of a specific optgroup. Any suggestens how to do that? Thanks.
1
vote
1answer
11 views

Rounding down issue with commerceCurrency filter

We have a site-wide sale on with 10% off products. On the category/detail page the commerceCurrency filter appears to round down, but when a customer adds an item to the basket, it's shown correctly ...
1
vote
0answers
16 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
9 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
1answer
27 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 ...
2
votes
1answer
46 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
17 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
20 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
21 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="...
1
vote
1answer
28 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
27 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
19 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
20 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
23 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
31 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
7 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
44 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
71 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
19 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
45 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
16 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
47 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
22 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
27 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
23 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
12 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
19 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
33 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
19 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
25 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
49 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
38 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
27 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
16 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
50 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
19 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 ...