Questions tagged [plugin-craftcommerce2]

Questions related to the Craft Commerce v2 plugin.

Filter by
Sorted by
Tagged with
1
vote
1answer
96 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
33 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
47 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
37 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
15 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
22 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
21 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
36 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
33 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
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 ...
1
vote
1answer
67 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
2answers
63 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
36 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
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
91 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
30 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
38 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
91 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
35 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
2answers
462 views

Customizing Stripe payment form for Craft Commerce 2

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
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 ...
1
vote
1answer
25 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
40 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
204 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
65 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
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 ...
0
votes
0answers
32 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
227 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
47 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() %} ...
0
votes
0answers
24 views

Print to Console Inside Event

I created a CUSTOM PLUGIN and I have the following code: Event::on(FOO::class, FOO::EVENT_NAMED_BAR, function(Event $e) { $message = "Hello world"; // craft::error( $message ); // ...
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
1answer
91 views

Importing Commerce Variants from google sheet

How I should set up google sheet data to import Commerce Variants from it? It is necessary that the Variants are imported in the same way as this example. Thanks.
3
votes
2answers
80 views

Commerce 2: View all orders of a specific product?

I'm looking to generate a sales report for a specific product It should not be linked to a user's orders but just a general list of sales for that product and its variants Is this possible? Thanks
1
vote
1answer
82 views

Commerce 2 — Guest checkout error: no customer email address exists on this cart

I'm having a problem with checking out as a Guest. Below is the design so you can see what I'm talking about... Although I'm entering an email address in the Guest Checkout email field — when I get ...
1
vote
1answer
143 views

How to use Saved Card in Craft Commerce

I was able to save cards by using savePaymentSource parameter in my payment form submitting at commerce/payments/pay. But how do I use these saved cards for making payments? I am using Stripe payment ...
1
vote
1answer
57 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 ...
3
votes
1answer
129 views

Setting Quantity Field on Subscriptions

How can I pass in a quantity value while creating a subscription? Plugin (version): Craft CMS (3.1.21) Craft Commerce (2.1.2) Stripe for Craft Commerce (1.2.0) Problem: My website allows users to ...
1
vote
1answer
37 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
1answer
358 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
1answer
91 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. ...
1
vote
0answers
56 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 ...
2
votes
1answer
82 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
1answer
12 views

Shipping for other category than what's set as default is not applied to total

Somehow, shipping rates are not applied to the total when checking out and paying. It does show when selecting the shipping method, but not on the final order review and is not submitted as part of ...
1
vote
1answer
20 views

Cart completed at gateway redirect issue

Recently I've found that when a customer goes to checkout and hits the craft\commerce\controllers actionPay() using a custom gateway that it's automatically marking the cart as complete. This never ...
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 ...
0
votes
1answer
85 views

Create different types of Donation purchasable? (for Gift Aid etc)

The new donations purchasable looks super handy for charity websites, thank you for this :) In the UK we have a thing called Gift Aid that allows charities to claim an extra 25% on donations/...
1
vote
1answer
218 views

Order Adjusters in Commerce 2

In Craft Commerce 1, there is documentation on how to re-order adjustments that do similar things. https://docs.craftcms.com/commerce/v1/adjusters.html#ordering-adjustments But I don't see any ...
1
vote
1answer
59 views

Mark a cart as complete from a plugin

How do I mark a cart as complete from a plugin? I tried setting isComplete = 1, it gets moved to orders but it is still a cart.
1
vote
3answers
121 views

How to display payment gateway error message only

I am trying to display the error message coming from the payment gateway ONLY. I know I can use {% set message = craft.app.session.getFlash('error') %} {{ message|length ? message }} but commerce ...