Questions tagged [plugin-craftcommerce]

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

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

How to get category id of lineItem to use in commerce adjuster

I want to add an adjustment to a product in the basket via an adjuster, only when the product has certain categories. (10% off if there are more than 6 same items in the basket. It's not possible to ...
Henrik's user avatar
  • 383
1 vote
2 answers
138 views

Stop customers from increasing line item

I have a site where the owners want to stop customers from ordering more than 1 type of item. The Twig logic is already in place to stop any forms showing that would allow customers adding more than ...
Jaytrix's user avatar
  • 187
1 vote
1 answer
35 views

How to make AJAX request to controller inside module?

Created a new module to receive form values and process API in Craft CMS 4. How to make an AJAX request to access a controller in my module? module name - giftcard controller - GiftCardController ...
Shankar's user avatar
  • 11
1 vote
1 answer
23 views

Craft Commerce Missing Products Tab

I've just installed the craft commerce plugin to trial it, but I'm not seeing the products tab under Commerce in the backend? Am I missing something? I'm using Craft 4.5.10. Thanks, Chris
Chris Nicholson's user avatar
0 votes
0 answers
22 views

Craft Commerce: Sell digital products from pool of predefined license keys

We’ve been asked to build a shop to sell e-books. The e-books are published by a third party and we will receive a list of pre-defined license keys (thus stock can run out). The plugin Digital ...
Moritz's user avatar
  • 69
1 vote
2 answers
42 views

Update Craft Commerce cart with ajax

Have been trying to get cart updates via ajax. I've looked at this answer: 'https://craftcms.stackexchange.com/questions/17347/update-commerce-cart-using-ajax' My cart seem to update ok but I can't ...
DieselHashtag's user avatar
1 vote
1 answer
56 views

I have an existing project called Craft cms v3.3, what should I do if I want to run it at local?(Mac OS)

I currently have a project that is definitely craft cms v3. I want to run it but this is the first time I keep stressing over it. Please help me
Phan Dương Ngọc Đô's user avatar
1 vote
1 answer
36 views

Why do I only have 3 options under 'Commerce' in Craft CMS Solo 4.5.6.1?

I have installed Craft Commerce 4.3.0 on Craft CMS Solo 4.5.6.1 on localhost (Xampp), but only have 3 options under 'Commerce' in the left-hand menu - Orders, Promotions, Store Settings. Do I need to ...
Andy's user avatar
  • 11
1 vote
1 answer
33 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
  • 187
0 votes
0 answers
60 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
30 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
53 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
29 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
63 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
91 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
  • 564
1 vote
1 answer
187 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
58 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
  • 10.7k
0 votes
0 answers
47 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
  • 647
1 vote
1 answer
89 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
84 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
96 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
  • 840
1 vote
1 answer
61 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
  • 10.7k
0 votes
0 answers
56 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
13 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
37 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
82 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
63 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
24 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
107 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
76 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
1 vote
1 answer
156 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
183 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
131 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
41 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
133 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
61 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
137 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
103 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
64 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
22 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
96 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
125 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
40 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
162 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
496 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
273 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
205 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
  • 564
0 votes
1 answer
146 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
  • 277

1
2 3 4 5
17