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 ...
3 votes
1 answer
169 views

Craft Commerce - Different confirmation email address for different product types or category

On a website I will be setting up there will be different ranges/types of products. Basically purchased from different departments within the organisation. I can filter the products in different ways ...
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 ...
1 vote
2 answers
500 views

How-to display a dropdown field with optgroups?

The display of a dropdown without optgroups is defined: {% set field = craft.app.fields.getFieldByHandle('<FieldHandle>') %} <select name="fields[<FieldHandle>]"> {% for option ...
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 ...
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
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 ...
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 ...
5 votes
1 answer
2k views

Update Commerce Cart using Ajax

Is there a way to update the cart using ajax? I've tried something like: $('span.quick-cart-add>p>a').click(function(e){ e.preventDefault(); var data = {}; ...
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
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 ...
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 ...
1 vote
1 answer
263 views

Update Cart’s address ID from plugin

I want to try and stop Commerce 3 creating a new customer address if it’s a duplicate of an existing one. As an example, a store selling digital products has a checkout form that simply asks for the ...
1 vote
1 answer
98 views

Is there a Zendesk plugin to fetch order information from Craft Commerce?

I'm looking for the same functionality as https://wordpress.org/plugins/mwb-zendesk-woo-order-sync/ but for craftCMS's Commerce plugin and not Wordpress's Woocommerce plugin. Basically, it would use ...
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()->...
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 ...
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 ...
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
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 ...
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-...
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. ...
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 ...
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 ...
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 ...
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-...
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( ...
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() ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
1 vote
2 answers
269 views

Feedme plugin - importing users into craft commerce

I have few questions about importing users into Craft CMS using feedme. These users would be also Craft Commerce customers. Users will be imported without passwords. Would this provide some kind of ...
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 ...
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 ...
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 ...
2 votes
2 answers
359 views

Craft Commerce: Sort products by Sale price

Trying to sort products by price. {% set products = craft.commerce.products({ type: 'footwear', limit: shopSettings.productsPerPage, order: 'defaultPrice asc', }) %} It works fine. Please ...
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 ...
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://...
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->...
1 vote
1 answer
184 views

Module: adding amounts to total item price, based on chosen option (e.g. giftWrapped)

I made a module, which should add an amount to an item, based on the chosen option. For example, if user checks "gift wrapped" 5$ gets added, if "Gift wrapped with Card" is chosen, ...
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 ...
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 ...
0 votes
1 answer
341 views

Craft Commerce product export to CSV?

Does anyone know if it us possible to export products from Craft to a CSV? I can't see anything native. Sprout reports seems like it might be able to but it looks quite complicated.
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 (...
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 ...
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 ...
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 ...
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 ...

1
2 3 4 5
17