Questions tagged [plugin-craftcommerce]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
27 views

Big upgrade completed locally, how to upgrade live?

I have a site that was Craft 3.4 and Commerce 3.x (unsure of exact version). Locally, I've been spent a big chunk of today updating to the latest versions of everything and making sure all still works ...
Jaytrix's user avatar
  • 167
0 votes
0 answers
52 views

Commerce 3: How to programmatically create a custom field and assign it to a Product

With this kind of setup: function random() { return array_reduce(range(0, 9), fn ($x) => $x . range('a', 'z')[rand(0, 25)], ''); } $salt = random(); $result = Craft::$app->getFields()->...
msbit's user avatar
  • 121
0 votes
0 answers
21 views

How to export a list of customers per domain?

I got a Craft (-v 3.7.67) Commerce (-v 3.4.20) setup with 4 sites in two domains. I need to export a list of customers (or users, in my case users are 99% customers) per domain (so users that have ...
Antoine's user avatar
  • 143
1 vote
1 answer
42 views

Is manual payment possible for Craft Commerce subscriptions?

I need to allow manual payments for Craft Commerce subscriptions. Typical users for this industry sector require an invoice and then make a bank transfer, and don't want to use credit card. It's low ...
Graham Bennett's user avatar
0 votes
0 answers
22 views

Interface "React\Promise\ExtendedPromiseInterface" not found

So I upgraded the page from Craft 2.9 to latest 3.x.x version. Now I am trying to install a plugin and I get this error - any help? Cheers
Zoruak's user avatar
  • 11
1 vote
2 answers
44 views

Product URL missing category slug on production site

I upgraded a Craft CMS 3 site to version 4. The Product URI Format for my products look like this: Before I re-save a product, the URL displays correctly the way it looked in Craft 3: But when I re-...
nitech's user avatar
  • 679
1 vote
1 answer
71 views

Commerce LineItem Option validation

I have Line Item options that I'm trying to validate in a module. I'm using the example code from the docs here on the front-end of the cart. Below that it says: Commerce does not validate the ...
supazu's user avatar
  • 534
1 vote
1 answer
110 views

Craft Commerce 4 - customer phone number/address?

i am using Craft Commerce 4 and cannot get my head around how to add a phone number to a customers address at Checkout. I have a Commerce 3 site but the code does not work. I can see how to add a ...
Malcolm Maclean's user avatar
1 vote
1 answer
43 views

Set default values for new Commerce products

I'm trying to set some defaults for newly created products. That is, when a new product is created, I want to set some settings to specific default values, but users should be allowed to change those. ...
MoritzLost's user avatar
  • 9,657
0 votes
0 answers
42 views

How can I enable the use of multiple discount codes on one purchase?

I have a group of customers who are eligible for discounts - 20% off one type of product and 40% off another. The problem is that they will sometimes want to order both types of product in the same ...
CMUK's user avatar
  • 1
0 votes
1 answer
16 views

reverse relation question in Commerce

I have a reviews section with an entry field to Commerce products. I'm trying to show the reverse relationship review on the product page. It appears to work when there are related entries but when ...
glider's user avatar
  • 635
1 vote
1 answer
78 views

How to persist modified order of cart line items?

I wrote a function to sort / re-order the line items in a cart. function sortCart(Order $order) { $lineItems = $order->getLineItems(); $lineItemsOrdered = array(); // [...] $order-...
kindoflike's user avatar
0 votes
0 answers
64 views

How to modify a custom field on cart, when the cart is created

I want to set a custom field on shopping cart when I first retrieve it. https://craftcms.com/docs/commerce/4.x/extend/events.html#modifycartinfo sounds appropriate so I tried doing this: Event::on( ...
kindoflike's user avatar
1 vote
1 answer
82 views

Delete All Products (and their variants)

I'm looking for the correct way to delete all of the products and related variants from my Commerce site. This is just for my local development environment as I'm debugging an import job. The delete() ...
cherrykoda's user avatar
  • 790
1 vote
1 answer
57 views

How to represent member discount for Commerce products?

I'm working on a Craft Commerce project where users can register for paid events. The events have a different price for members and non-members of the organization the site belongs to. I'm not sure ...
MoritzLost's user avatar
  • 9,657
0 votes
0 answers
53 views

Apple Pay and Google Pay with Craft Commerce Stripe plugin

I was wondering if there is a simple solution for getting Apple Pay or Google Pay working with the Stripe payment gateway plugin? I have been looking around and saw a plugin but it only works for ...
Malcolm Maclean's user avatar
0 votes
0 answers
10 views

Craft order not showing in order overviews in CP

I'm working on a very old Craft CMS v2 (Craft commerce v1) website. This site sells tickets and occasionally has issues where people successfully pay for their tickets but the system doesn't get ...
Mosh's user avatar
  • 153
0 votes
0 answers
21 views

Create transactions in back-end using Affirm API

I'm using Affirm API to have monthly payments available on the e-commerce but now I need some help updating the order payment information status after I get the response from Affirm. I guess I need to ...
GaelP's user avatar
  • 21
1 vote
0 answers
33 views

Object of class craft\commerce\models\ShippingMethod could not be converted to int Error generating from craft commerce

At a little bit of a loss here, just updated a Craft 3 site and I've started getting an error thrown whenever the cart is accessed. Relevant updates were: CraftCMS 3.7.11 -> 3.7.27.2 Craft ...
Josh Parylak's user avatar
0 votes
0 answers
69 views

How make custom order fields required with "event_define_rules" like a required address fields?

I want to make a craft commerce custom order field required (server side). I already use this for require the default address fields. But how to add custom fields? Because this is done on the Address ...
Maarten Heideman's user avatar
1 vote
1 answer
57 views

Batch retrieve the entry count per category item in facet filter

I'm building a facet filter using Craft Commerce products and Craft categories. I have a "Brand" category and each product entry has a brand defined. Same for the other facet filters that ...
Jesse's user avatar
  • 113
2 votes
1 answer
23 views

Feed me plugin craft\commerce\services\ProductTypes::hasPermission(): Argument #1 ($user) must be of type craft\elements\User

Whenever I run a feed via the Direct link eg. https://site.com/index.php?p=actions/feed-me/feeds/run-task&direct=1&feedId=[id]&passkey=[passkey] when I'm logged out of the CP. I get the ...
Hassan Mahmood's user avatar
1 vote
1 answer
93 views

How can I best add additional fields to the Address form during the checkout

I want my customers to enter their date of birth and place of birth during the checkout. Do I have to overwrite the Address commerce model somehow? (\craft\commerce\models\Address). Something else I ...
Rayco's user avatar
  • 11
1 vote
1 answer
73 views

How To Designate Adjuster on Order Only

Registering like so and all is well. Event::on( OrderAdjustments::class, OrderAdjustments::EVENT_REGISTER_ORDER_ADJUSTERS, function(RegisterComponentTypesEvent $event) { $event->...
Steve Mock's user avatar
0 votes
0 answers
29 views

How can I pass email addresses in the First Name <[email protected]> format (mailbox format) in Craft Commerce order status emails?

I am building a shopping cart site for a client to integrate with his existing customer base. He has his customers' email addresses saved in this format: First Name [email protected]. From what I ...
Trenton Marshall's user avatar
1 vote
1 answer
120 views

Commerce: Calling unknown method error on Edit Address screen

I'm using Commerce 3.4.16, Craft 3.7.51. I'm able to enter an address as part of checkout, and I can see that address in the CP, but when I go to the edit address screen on the front end, I get this ...
artmem's user avatar
  • 1,012
0 votes
1 answer
163 views

Custom fonts in pdf

I want to render two custom fonts in my commerce pdf, but it does not work. I tried it in several ways: I use the @font-face and used the path as well the URL and also put the font files in different ...
Sanbo's user avatar
  • 129
2 votes
0 answers
121 views

Commerce shipping tax rate based on tax rate of line items

I have a shop with products that have 6% VAT & products with 21% VAT. The VAT rate that is applied to the shipping cost should depend on the VAT rate of the line item with the highest subtotal (...
Fred's user avatar
  • 21
2 votes
1 answer
38 views

Problem running a sale on the site

Craft shows the sale running, and can tell which products are on sale using a: {% set saleProducts = craft.products() .hasVariant({ hasSales: true, hasStock: true }).all() %} loop, but on ...
madev's user avatar
  • 21
2 votes
0 answers
121 views

Commerce 3 - Register user and save payment source after order complete for guest checkout

We register and send account activation emails to guest customers after checkout using registerUserOnOrderComplete. We also want the guest customer to be able to save their payment card during ...
iamkeir's user avatar
  • 458
1 vote
1 answer
55 views

Craft Commerce: Replacing Adjuster causes error "Something changed with the order before payment, please review your order and submit payment again."

In a current project we need more complex logic to determine when to set the VAT to 0%, so we do this with an adjuster added through a module. We are using the exact method described on https://...
Roy Baijens's user avatar
1 vote
1 answer
126 views

Add amount to cart line item

On the "add to cart" page, I let the user enter "Width" & "Length" to calculate the number of Square Foot as the quantity which works fine with a JS function. Now my ...
Sylvain Tremblay's user avatar
2 votes
1 answer
101 views

How I'll get the orderId in EVENT_AFTER_COMPLETE_ORDER in craft commerce?

I'll want to update an orderStatus in craft commerce after the order is complete for a specific (digital) pruduct type. To send an extra email with download links, confirm email is already send based ...
Maarten Heideman's user avatar
1 vote
1 answer
60 views

How can I add a bottle deposit to a product?

I have to add a bottle deposit (like an extra fee) to some bottles in the shop and have no idea how to do this. The bottle deposit must be shown in the product view and in the shopping cart and also ...
Sanbo's user avatar
  • 129
0 votes
0 answers
21 views

Commerce CP Shipping Errors

Craft Commerce 4.0.2 trying to EDIT shipping rules and getting this kind of error : Cannot assign string to property craft\commerce\models\ShippingRule::$maxTotal of type float Anyone getting this ...
Sylvain Tremblay's user avatar
2 votes
1 answer
93 views

how to round Discounts (either half of full number) or total of cart

i have a 10% Discount for more than 6 items. With several items i get discounts like 12.48. How can i round this discount amount, so that this amount is also applied for the cart total amount? The ...
Henrik's user avatar
  • 383
2 votes
1 answer
107 views

CraftCMS Commerce order by most sold products

I am currently working on a project where I have to sort products based on their times being sold. Unfortunately I could not find anything related to this functionality. Where do I start to implement ...
Kimixi's user avatar
  • 21
1 vote
1 answer
37 views

Category as variant

In Products (Craft Commerce), I've set custom fields. Some are texts, some are related to a Category. Actually, there's 2 different categories per variant... In order to draw the fields, I need to ...
Sylvain Tremblay's user avatar
0 votes
0 answers
156 views

Craft Commerce variants and stock limit

I'm working on solution that shows product variants with ability to select attributes in the front end. Now I have code like this: {% set colour = colour ?? [] %} {% set length = length ?? [] %} {% ...
Lukas Snarskis's user avatar
1 vote
1 answer
445 views

How to retrieve (& output via twig) one key pair of json object stored i a database column

in commerce, all transactions are written into the database, into the table "commerce_transactions". every transactions will result in a row, where different data is the stored into columns. ...
Henrik's user avatar
  • 383
1 vote
0 answers
253 views

Craft Commerce 3 guest checkout flow – can't update addresses

I'm finding a guest checkout flow in Commerce 3.4.14 insanely confusing, docs aren't much help. I'm using Craft Solo and Commerce Lite. TL;DR I realize the code below is probably too complex, so even ...
Yawner's user avatar
  • 65
2 votes
2 answers
192 views

Get order shipping address in module

I'm trying to add an address column to my orders index but I'm having trouble correctly getting the actual address. From my code below, when I dump on $orderShippingAddress I get the ID of a valid ...
supazu's user avatar
  • 534
0 votes
1 answer
127 views

Craft Commerce - add additional message during checkout

We can add a message to a product while adding it to the cart as per this question here - Option and notes fields after cart at checkout for order, not just line items But is there a way to add a ...
Mark's user avatar
  • 267
1 vote
1 answer
89 views

Eager-Loading Cart images

The cart of Craft Commerce can't really be cached so I try to increase performance by loading product images in the cart via eager-loading. All tutorials tell me to use the .with(['variantThumb']). ...
KSPR's user avatar
  • 3,756
1 vote
1 answer
25 views

Commerce show customer only once even with multiple orders

Is it possible to print a list of customers but display a customer only once even when he/she ordered multiple times? {% set orders = craft.orders.completed(true).limit(null).orderBy('dateOrdered ...
KSPR's user avatar
  • 3,756
2 votes
1 answer
120 views

Craft Commerce multisite mail origin

I have a multisite setup where 2 sites can make orders on the same commerce, but I would like to have dynamic mail settings (domain name, origin, api keys, etc) based on the site of the order. Do you ...
Antoine's user avatar
  • 143
1 vote
2 answers
117 views

Sending Craft Commerce Orders to Salesforce.com

I know similar questions have been asked before... but they are a bit dated and there was never a clear answer. I'm looking to send order information from Craft Commerce to Salesforce.com. It's a ...
gwineman's user avatar
0 votes
0 answers
34 views

Twig call to get REFRESHED payments

I use commerce for subscriptions. We design a twig page to show subscriber's payment history. For some reasons, the very last purchase don't show as we need to perform a "refresh-payments" (...
Sylvain Tremblay's user avatar
2 votes
1 answer
120 views

Craft Commerce Subscriptions

We're using commerce 3.2 and were testing the plans options with the default templates. We've put in the Stipe test keys, but when we try to subscribe, we get the message: Unable to start the ...
Mark's user avatar
  • 267
1 vote
1 answer
70 views

How do I reset all Commerce order references?

By default, Commerce uses the {{number[:7]}} format to set an order's reference on order completion. Now (after the site already has orders and I can no longer reset the site's data), I need to use a ...
Paul's user avatar
  • 6,338

1
2 3 4 5
17