Questions tagged [plugin-craftcommerce2]

Questions related to the Craft Commerce v2 plugin.

55 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
20 views

What are the replacements for the order events onBeforeAddToCart and onBeforeGatewayRequestSend in Commerce 2

I'm looking for replacements for the events onBeforeAddToCart and onBeforeGatewayRequestSend. I used onBeforeAddToCart to prevent the user from adding an article from different article groups to the ...
2
votes
0answers
74 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
0answers
76 views

How best to add price tiers based on user group

I'm new to Craft Commerce. I wish to add around 10 price tiers to each product. Users are in groups and the group determines which price tier they pay. All the data is to be imported (and kept up to ...
2
votes
0answers
371 views

Searching for Multiple Categories and Tags

I've been pulling my head for the past day on how to filter products with multiple categories. After a long search, I found and implemented on my project, Advanced Search with tags and categories It ...
2
votes
0answers
54 views

Add custom column to the orders list page

Does anybody know if it is possible to add a column to the orders list page? I can choose the 'Foo' label, but when the page want to show the orders list I get the following error: "{"error":"An ...
2
votes
0answers
91 views

Commerce 2 Multi-site Support

I'm currently working on a multi-market Craft3 project with Commerce2. Each product can and will have a different fixed price on each page. Product A project.tld/de-de - € 120 project.tld/en-gb - £ ...
1
vote
0answers
11 views

How can I search for Craft Commerce orders with a specific product?

Is it possible to narrow the order query from the default order listview in the CP from Craft Commerce? Because I’ll want to show all orders with a specific product so I can export them.
1
vote
0answers
12 views

How to fetch products related to every product within an array?

I’ve got products which are related to various products of another type (product.accessories). Now I’m trying to fetch all products related to every single product within a given array. My first ...
1
vote
0answers
18 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 ...
1
vote
0answers
22 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 ...
1
vote
0answers
21 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 ...
1
vote
0answers
52 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 ...
1
vote
0answers
20 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', '...
1
vote
0answers
31 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, ...
1
vote
0answers
21 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
87 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
0answers
39 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
0answers
55 views

Create Manual Order for another customer

Is there any way for an admin to use the Manual gateway and create an order for another customer in the system? Or is the only option for the admin to Log In as User feature and go through the ...
1
vote
0answers
43 views

Looping over categories, product variants, and subsequently applying adjuster(s)?

Using the Craft 3 and Commerce 2 APIs, how would one go about looping through products in the cart to apply adjusters, looking at the following example; A category, "Product Packs" is set up where ...
1
vote
0answers
117 views

XMLHttpRequest Craft Commerce Cart Update Issues

When using XMLHttpRequest to update cart like the following, I get a 500 error for 'lineItems': {[lineitem]: {'qty': value}} (and also {[lineitem]: {'remove': true}}, any other submission works); var ...
1
vote
0answers
35 views

How to keep a users cart active after logout - Craft Commerce 2

How do I set the cart to save / stay active in a users account. When I add some products to my cart (when logged in) and logout or close my browser the next time I come back my cart is empty. I'd like ...
1
vote
0answers
22 views

How to modifyPaymentRequest() in Commerce 2?

Looks that I really used every functionality in my plugin that changed or has been removed in Commerce 2. :( I need to modify paypal transactionId and description what i did as follows in Commerce 1: ...
1
vote
0answers
17 views

Paginate a list of product variants with categories parameters

I have got a category multi-select feature that allows users to filter variants by more than one category. On selection the URL is concatenated as a new category as follows: ?cat=blue ?cat=blue+...
1
vote
0answers
119 views

Extending Craft Commerce Purchasable Nav Items

I'm looking to extend Craft Commerce with a custom Purchasable. I'd like to implement this using a module if possible. I've implemented the base class for my new Purchasable and that's all good. ...
1
vote
0answers
28 views

Commerce Discount Issue/Discepancy

In Craft 2 Commerce 1 one could apply a coupon code with "per email limit" during checkout, without having the email added to the order/cart model(s). In Craft 3 Commerce 2 the same scenario yields ...
1
vote
0answers
33 views

Product variant association

On my Products details page I have 2 selects. The 1st select list out the Primary variants. Based on the selected Primary variant the 2nd select is auto-completed in with Secondary variants that have ...
1
vote
0answers
81 views

Craft Commerce 2: Get products which are availableForPurchase

I try to get all the products of a certain category which have availableForPurchase set to true. {% set criteria = craft.products.type( 'weine' ).relatedTo( cat ).search( 'availableForPurchase:1' )....
1
vote
0answers
49 views

Complex shipping logics

In Craft Commerce 2, we have two shipping categories: PostNL, which is one of the Dutch main shipping methods, which we use for packages that fit in the mailbox. For this category we use the weight ...
0
votes
0answers
14 views

Funky Shipping, Requiring Cart Updates

So we have a shipping logic on a site of (yes, that way round) < £5.00 => Shipping = £0.00 >= £5.00 => Shipping = £2.50 Currently, we have an issue where sometimes shipping is set to £5....
0
votes
0answers
28 views

How to save a product via PHP in Commerce 2?

I'm trying to save a new product with variants via PHP. $product = \Craft::$app->elements->createElement(\craft\commerce\elements\Product::class); $product->typeId = 1; $product->enabled =...
0
votes
0answers
12 views

Twig Shipping same as Billing Address

Is it possible to write a twig conditional if the Billing Address is not the Same as the Shipping address? {# something like #} {% if order.shippingAddress is the same as the billing address %} {...
0
votes
0answers
21 views

Commerce 2: multiple carts or wishlist

Is it possible to have multiple carts in Commerce 2? Like having a normal cart and e.g. wishlists for certain occasions. On the product page you can decide to which cart you want to add your item.
0
votes
0answers
16 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
24 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 ...
0
votes
0answers
11 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
20 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
39 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 ...
0
votes
0answers
11 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
15 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.
0
votes
0answers
11 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 ...
0
votes
0answers
23 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
27 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 ...
0
votes
0answers
8 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.
0
votes
0answers
47 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
24 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 ...
0
votes
0answers
31 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 ...
0
votes
0answers
32 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 ...
0
votes
0answers
35 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 ...
0
votes
0answers
29 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 ...
0
votes
0answers
19 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 ...