Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [plugin-craftcommerce]

Use this tag for questions relating to the Craft Commerce product.

2
votes
0answers
27 views

Creating customer records and saving cards during Stripe checkout?

My client is looking to, on occasion, assign a recurring Stripe plan to a one-time donor (most donations on this site are one-time). The best way to do this would be to create a customer in Stripe (...
1
vote
0answers
35 views
+50

Some orders recieve double amount of products

I have a pretty critical issue with one of my clients websites. The site, running Craft CMS 2.7.2 and craft commerce 1.2.1364, uses a event/tickets plugin and uses Mollie as the payment provider. ...
1
vote
1answer
17 views

How to get the name of a product's sale

I am still new to craft commerce and I have 5 sales, some are flat and others are percent. When i loop through my products, I am trying to get the type of the sale for the current product. How do i ...
1
vote
1answer
19 views

Commerce 1 find if Discount object is valid based on start/end dates (Twig)

In Twig, I want to find out if a discount is valid based on start/end date. startDate and endDate don't seem to exist and I can't inspect the discount object by using the json_encode filter (returns {...
1
vote
1answer
13 views

Payment Method and Discount elements query by ID in Twig

In Craft 2, is it possible to query a specific element by ID in Twig? They aren't mentioned in the docs. I was trying things like these but without success: {{ craft.commerce.paymentMethods.id(1)....
1
vote
1answer
39 views

Extend a Commerce (v2) order template in the control panel

Is there a way to extend (extend, not replace) the default Commerce order templates in the control panel? I'd like to display important custom fields in a prominent way on the first tab. (and not ...
1
vote
0answers
11 views

Shop setup for subscribed members

Before I start to build this store on my own, I would like to ask if anyone can provide some guidelines on the following setup. I am trying to build a store with a member area for subscribed members ...
0
votes
0answers
20 views

Remove decimal 0 from number in PHP [migrated]

Need to remove zeros after number in decimals so for example 100,01201500 will become 100,012015 I have now this function: php echo number_format($plan['price'], 0, '.', '' ) - this remove all ...
2
votes
1answer
25 views

Mark a Commerce Order as Paid, via a custom plugin

Checkout / Payment is being handled entirely by a 3rd Party. What would be the correct process to mark an Order as Paid via a custom Craft plugin? The Order will already have been converted from a ...
1
vote
1answer
33 views

How do you reset a cart under Craft Commerce 2?

How do you reset or empty the cart, in Commerce 2? There is no mention of this in the documentation. In Commerce 1, it was possible to issue a request to the commerce/cart/removeAllLineItems action ...
1
vote
0answers
15 views

Commerce: reading Stripe object in Craft Transaction model

I'm looking to add the credit card last four digits to my customer's frontend order history. Stripe is the gateway. The Stripe transaction object doesn't seem to be available in the Craft ...
0
votes
0answers
10 views

Craft Commerce Discounts - Promo code for one free item if there are five items in cart

Our site will offer only one product. Can we create a promo code that will apply 100% discount on 1 product if there are at least 5 products in the cart? I was playing with the conditions and had: ...
0
votes
1answer
17 views

Commerce Stripe Authorize Only - Capture partial amount in Craft admin panel

It doesn't look possible but can you capture partial amounts using the Craft admin panel? E.g. Authorize $1000, then capture $700. Also, when performing Captures in the Stripe panel, these ...
0
votes
2answers
42 views

How can I embed Image into Craft Commerce 2 PDF Receipt

How do I embed an image (PNG,SVG or JPG) into a CraftCMS Commerce 2 PDF receipt? I tried importing the svg using an includes. I tried using an img tag and referencing a local file. Nothing seems to ...
2
votes
2answers
43 views

Getting products with Craft 3 and Craft Commerce 2

I've never had success using Craft 3 with Commerce 2 beta. I always get an error that ".find()" is not recognized, and ".all()" doesn't work either. My latest attempt has given me this error: Twig ...
2
votes
1answer
29 views

Is it safe to move Craft Commerce Templates out of Plugin

I installed Craft Commerce 2 and the templates are in vendor/craftcms/commerce/templates/shop. Is it safe to move these to my craft templates folder like this? ├── storage ... │   └── runtime ├── ...
2
votes
1answer
19 views

Override “sameAddress” option when updating cart

I'm working on a new checkout process which involves taking the shipping address first. To do this I am setting sameAddress to 1 in my shippingAddress form. Then, at a later stage I want to offer ...
2
votes
1answer
34 views

How can I show a list of product options as checkboxes in the cart?

In my cart (Craft3/Commerce2), I need to show a line item's possible options from a checkbox field called "productOptions", and allow the user to select the desired options. Based on the Craft Docs, ...
1
vote
1answer
60 views

Craft Commerce 2 — Remove Line Item (and other actions)

Knowing that all other actions besides update-cart has been deprecated I'm curious what needs to be passed with the action to remove a line item from the cart using a button as opposed to check a ...
3
votes
2answers
54 views

commerce/cart/updateCart throws page not found

Adding products to the cart throws a page not found (404) error that has this header; Page not found. ↵ Caused by: Invalid Route – yii\base\InvalidRouteException Unable to resolve the request: ...
1
vote
0answers
16 views

Add optional segment to Craft Commerce product Url

I currently have a Craft Commerce site where the product url is setup like this: {productCategory.level(1).first().slug}/{productCategory.level(2).first().slug}/{productCategory.level(3).first().slug}...
2
votes
1answer
24 views

Craft 2: Is there a hook for Craft Commerce Orders admin page?

My plugin is sort of an extension for the Craft Commerce, where I need to provide custom data on the craft commerce orders page. So I'm wondering is there a way to listen for an event, which fires ...
1
vote
1answer
18 views

How can we use TaxJar with CraftCommerce?

Is there anything akin to a presave event or postsave event where we can make a call to TaxJar API to get calculate and report sales tax? I find the integrated tax system impractical at the moment. I ...
0
votes
0answers
12 views

Craft Commerce: Validation on custom variant field

This is a Craft Commerce question and it's very similar to this question, but I believe it's different. I need to validate some custom fields inside product variant before saving, so I added ...
1
vote
1answer
49 views

Commerce PDF error: Image not found or type unknown

In the order template, this error shows up in the generated PDFs when adding standard JPG images. We're running Commerce 1.2.x on PHP70. It could be related to this dompdf issue, but how do we fix ...
2
votes
1answer
37 views

Need to access each item's converted price from payment gateway

I am trying to implement multi currency to my payment gateway plugin. I need to get converted price of the line item. Each item from Omnipay\Common\Item has the price of non converted, main price of ...
1
vote
1answer
19 views

Can I add a billing address while updating the cart?

I'm designing a donation form right now for what will be a Craft Commerce site, and I want to collect the donator's billing name, address, etc in the product form which adds the donation to the cart. ...
1
vote
1answer
60 views

Craft Commerce Shipping Total Order Price rule

I have a webshop where you can get free shipping when the minimum total order price is €150. Product prices are set up so they include VAT (21%). VAT is removed when orders are shipped outside the ...
0
votes
0answers
33 views

Craft Commerce Plugin - How to refresh/reload/redirect page in onStatusChange

I need some help in a craft backend plugin. I use this plugin in a commerce order page. I'm using it to handle onStatusChange (commerce_orderHistories). In this event, i'm testing a custom variable ...
2
votes
1answer
19 views

How to get all available tax rates in a Commerce 1 site?

Is there a way to retrieve and loop through all the available tax rates that have been set up in Commerce 1? I had thought I could loop through the adjusters like so; {% for adjustment in cart....
1
vote
1answer
48 views

302 redirect when updating the cart via Ajax using Craft Commerce 2

I'm working on a site that has recently migrated from Craft v2 with Commerce v1 to Craft v3 with Commerce v2. Using Commerce v1 I was able to update the cart via Ajax and get a data object with the ...
1
vote
1answer
33 views

Commerce - how to display order address in email to customer?

I'm new to commerce but almost I've cracked all I need to my project but one piece still left. I can't display order shipping address. I've tried {{ order.shippingAddressId(shippingAddress) }} but it ...
1
vote
1answer
23 views

Is there a way to retrieve discounts for a product in Craft Commerce v2?

I would like to retrieve all available discounts for an eshop using the Craft Commerce v2. In Craft Commerce v1, I could use the following: craft.commerce.discounts.all() However, I can't find an ...
1
vote
0answers
6 views

Select products that have stock and products where showWhenNoStock is true

We've been working on a sneaker shop and the product overview page is only showing the products that are in stock. Now the client also wants to show some selected products on the overview even if ...
1
vote
2answers
32 views

Is it possible to update multiple cart items?

To be more specific I would like to add an "update cart" button so that the visitor can adjust the quantity of multiple cart items without having to click on "update" for each cart item.
0
votes
1answer
39 views

How do I send PayPal the Craft Commerce Order Number?

The client is using PayPal Express for the payment gateway. When orders are placed, Paypal shows the ID for the order, not the Order Number. Is there somewhere I can change that?
1
vote
0answers
36 views

Filters using multiple query strings with pagination and Craft Commerce

I want to build the ability for the user to be able to filter by certain categories when browsing an existing category. As well as this I would like the user to be able to control the ordering of ...
1
vote
1answer
83 views

Craft Commerce payment gateway: general info requested

one of our clients requested us to create a global webshop for their business. We have little experience with webshops and as we are avid fans of Craft, we'd like to start on this project with Craft ...
1
vote
1answer
14 views

How to render a state abbreviation in Craft Commerce?

Folks, this has to be easier than I've made it. In a front-end template, how do you grab a state abbreviation from a customer's address in Craft Commerce? {$ set addresses = craft.commerce.customer....
1
vote
1answer
18 views

Sales prices on items

Is it possible to have both the standard price and sale price visible on the items tiles on a website? I would like to have both prices visible and wanted to know if this was doable .
1
vote
2answers
131 views

Craft Commerce — Billing / Shipping Address validation / required Fields

As default Craft has only First Name and Last Name as required. Is it possible to set more as this two fields as required fields? And is it also possible to set custom Fields as required too?
1
vote
1answer
30 views

Is there a way to change prices

Is it possible to reduce and increase prices on all products at one time by a specified amount or percentage without having to manually do every product. That must be visible to the customer and not ...
0
votes
0answers
16 views

Reducing number of queries for craft()->commerce_variants->saveVariant($sku)

Is it possible to reduce the number of queries for saveVariant ? craft()->commerce_variants->saveVariant($sku) This line adds 26 queries. When adding multiple variants at the same time this ...
1
vote
1answer
21 views

Is there a way to know if a discount is going to be applied on a product?

I have set up a number of discounts using Craft Commerce. Those discounts apply to specific groups of users and types of products. Is there a way to know inside the template, if a discount is going ...
0
votes
0answers
6 views

Show sales price to all visitors although price applies to specific group

I'm building a shop using Craft Commerce Pro that offers a discount to all registered members. For each product, I want to show all visitors both the full price and the discount price of each product ...
0
votes
1answer
61 views

PayPal Currency - Item bag total price does not equal the orders totalPrice, some payment gateways will complain

We are using PayPal standard as an option for payments which works in the main currency (GBP) but not in any of the others eg (CAD). We're seeing in the plugin logs for craft commerce: [Forced] Item ...
1
vote
1answer
31 views

Is there a way to get the URL of the localised version of a product variant?

I have a website that uses Craft Commerce and I'm trying to add a language menu that points to the localised version of each product variant as follows: {% set variantID = craft.request.getParam('...
1
vote
0answers
73 views

Craft 3 / Craft Commerce Installation - Can't see products

I recently tried to install Craft Commerce onto Craft 3. I installed the plugin via the plugin store and added in the templates folder which I downloaded straight from https://craftcommerce.com/ and ...
1
vote
2answers
55 views

Overriding BaseFrontEndController in Craft Commerce

Is there a clean way to alter the cartArray that is returned when updating the cart through ajax? Which is defined in the BaseFrontEndController Craft Commerce. For example by using a module? In this ...
1
vote
1answer
101 views

Subscription with Craft Commerce

I am using Craft Commerce v2 plugin with Craft CMS v3 with one of my site which basically sells kid products. It's a subscription website and ones some parent subscribe for any kids package, they ...