208 questions
1
vote
0
answers
66
views
Recalculate order just before sending user to external payment - Drupal Commerce and Paypal
Summary: Customer could be charged a different amount from what is displayed in the Payment step panel if an auto-applied promotion gets published or unpublished just before external payment is ...
0
votes
0
answers
22
views
How to Handle Multi-Date Events with Multiple Add-Ons in Drupal Commerce?
I’m developing an event registration system in Drupal where:
Events have multiple dates (users select specific dates).
Add-ons (e.g., dinner, lunch) can be attached to events.
I created a PoC using ...
0
votes
1
answer
52
views
Google Captcha is hidden upon calculating the shipping cost in Drupal Commerce checkout form
I have the following form
function beyond_shipping_form_alter(&$form, FormStateInterface $form_state, $form_id) {
if ($form_id == 'commerce_checkout_flow_multistep_default') {
$...
0
votes
0
answers
41
views
Not saving total price for orders in drupal commerce
I tried to implement saving total price in orders but it`s returning an issue like before saving everything is good, but after it debug returning null
protected function createOrder($order_data) {
...
1
vote
1
answer
562
views
Can't install drupal commerce with composer error
can't install commerce by use composer, I tried both command :
composer require drupal/commerce
composer require 'drupal/inline_entity_form:^1.0@RC
when I used "composer require drupal/commerce&...
1
vote
0
answers
212
views
Drupal custom payment module form problem
I'm a bit new to drupal and i'm trying to create custom payment gateway module and stuck with a problem.
When creating OnSitePaymentGateway, everything is ok and i can edit checkout form with ...
0
votes
1
answer
23
views
Drupal Commerce API installation failed - TypeError: strpos() expects parameter 1 to be string
I have installed Drupal commerce on Druapl 8 site. I need to expose commerce features via an API. when I try to enable Commerce API module I am getting following error.
TypeError: strpos() expects ...
0
votes
1
answer
240
views
How to check the machine name of the product type?
I have the TWIG code below that works. It checks that "Produit" is in the name of the product type.
My problem :
I want it to check the machine name of the product type (not the title of the ...
0
votes
0
answers
110
views
How can I add Commerce Wishlist share mail template variables from form?
I am trying to add 2 additional form fields to the Wishlist Share form where the user input will be rendered in the email. I have been able to add the fields to the form, but I am not sure how to add ...
0
votes
1
answer
96
views
How to limit access to a store page to the store owner?
I created a custom module to create a /store/ID/tasks page
https://www.drupal.org/project/commerce
How to limit access to this page to the store owner ?
If the current user is owner of store ID 76, he ...
1
vote
2
answers
861
views
In Drupal 8 commerce module how to get disounted amount from cart?
I'm looking into commerce module for drupal 8 and using its submodule commerce promotion. So i only want to get discounted price in current user cart. i got coupon code but that doesn't help to get ...
0
votes
2
answers
1k
views
drupal 8 commerce 2 - How to unpublish all published products and their products variations programmatically
I need to unpublish all "active" (published status == TRUE) products and products variations before every import of actual assortment on my site.
How to do it programmatically?
I see 2 ways ...
1
vote
1
answer
288
views
In Drupal 8. Drupal Commerce. How to hide a view based on Product field (Entity Reference - Taxonomy)
If I clicked a certain Product, it will be redirect to Product Page. Within this page, views will be shown or hides base on Product Category.
Example.
If Product Category is A.
- Shows View A and,
...
2
votes
1
answer
299
views
drupal 8 commerce get product returns empty object
So i have created a few products and added some data to it:
In my custom route i am then trying to get all products out using the following code:
$products = \Drupal\commerce_product\Entity\Product::...
0
votes
2
answers
138
views
How to make the address code on one line with TWIG?
I have a TWIG code to display the address of a store.
Currently the address is rendered on 3 lines.
How to make the address code on one line ?
{{ store.address|render|trim|replace({'<br>': ' -...
0
votes
2
answers
44
views
How to upgrade a module already distributed with Drupal Commerce?
Drupal Commerce 1 has included Crumbs 1.10.
I need to upgrade Crumbs to 2.7, and this version isn't included with Drupal Commerce.
How can I upgrade it without breaking Drupal Commerce distribution (...
0
votes
1
answer
2k
views
Get a calculated price of Product Variation
I created a promotion with offer type - Fixed amount off each matching product and applies to - Specific product. In my custom block I get the product entity, but don't see any promotions there. How ...
0
votes
1
answer
84
views
Drupal 7/PayPal Express Checkout: How to set delivery options based on address
I have the "PayPal Express Checkout" Drupal 7 module installed and I need to ideally register what country the customer is checking out from and charge them a standard shipping fee, for example:
UK: £...
0
votes
1
answer
735
views
How to display store fields from the product template?
I have a Drupal 8.7 site and the Drupal Commerce 2.14 module
In the template of my store to display the field field_professionnel_cgv I use this code TWIG :
{{ store.field_professionnel_cgv }}
How ...
0
votes
1
answer
1k
views
How to create a condition with TWIG and Drupal 8 to check the type of store?
I have a Drupal Site 8 with Drupal Commerce. I create 2 types of store:
personal_store
professional_store
I'm working on the template of my products and I want to display the code above only if the ...
0
votes
1
answer
136
views
How to make a Drupal Commerce configuration entity revisionable
I have an Ember application on the frontend consuming Drupal's JSONAPI.
Drupal has the commerce module installed.
The ember application is requesting all product_types, and needs to display ...
0
votes
1
answer
1k
views
How to name twig files by the region they are in?
I am using Drupal with the Commerce Module to build a webshop. I am using the Commerce Cart Block to display a cart icon with the amount of items in the cart, in the navigation bar.
Now I would also ...
1
vote
0
answers
59
views
Drupal 8 Commerce 2 product autocomplete only rendered for admin user accounts
On a fresh install of Drupal 8 with commerce 8.x-2.13 try to use the product autocomplete.
The autocomplete works out of the box for user 1 or any user with administration role, but not for any other ...
1
vote
0
answers
507
views
How to redirect the checkout complete page without using rules in drupal commerce 2.x
I need to redirect the checkout complete page with a link on that page . Once user click on that link get redirect to home page without using rules module in drupal 8.
3
votes
1
answer
1k
views
How to get country name from country code in Drupal Commerce
I get the country code from field_data_commerce_customer_address table in drupal commerce. Now how to get the full country name from this code.
1
vote
1
answer
1k
views
Drupal 8 views contextual filter using product type and a taxonomy term
I'm having troubles getting the contextual filter to work on a view.
I want products/type/kind to show only the products which have a Product Type of type and have kind as a term in a particular ...
0
votes
1
answer
191
views
Drupal 8: Only add to cart if user has enough credits
I've a site where transactions are based purely on credits. No actual money is exchanged. In such a case, I want to restrict users from adding products to cart if they do not have credits to do so.
...
1
vote
0
answers
147
views
Custom Payment gateway for Drupal commerce
I am trying to add a custom payment gateway to drupal commerce using the iframe method as shown in
Drupal commerce iframe
I am able to complete the payment and the success page is shown. But when I ...
0
votes
1
answer
971
views
How to overwrite commerce product details tpl.twig (commerce-product.html.twig) in theme template in drupal 8?
I created a bunch of products, but I need to style them per the designer's design. I know that I have to overwrite the template from /modules/contrib/commerce/modules/product/templates/commerce-...
2
votes
0
answers
58
views
How to recover the ID of the store where the order was placed?
I have a Drupal 8 site with a marketplace (several stores).
I want to display in the "review" step of the "Checkout Pane" a checkbox with the sales terms.
Currently if I order in 2 stores, this will ...
1
vote
1
answer
2k
views
COMMERCE ORDER - PDOException: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction
Here is my error message
PDOException: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when
trying to get lock; try restarting transaction:
UPDATE {commerce_order} SET
order_number=:...
0
votes
0
answers
45
views
Drupal commerce - Get all options from an option set
I have a drupal commerce website and I need to retrieve all options that are existing for my products. All of these options are in an option set called 'defaut'.
My problem is that I can't find a ...
1
vote
4
answers
3k
views
RuntimeException: The bcmath extension is required by NumberFormatter
I have installed drupal commerce module. I am getting the below error while viewing a product page.
RuntimeException: The bcmath extension is required by NumberFormatter. in CommerceGuys\Intl\...
3
votes
1
answer
11k
views
How to load all variations and its id by using product_id programmatically using Drupal Commerce-2.x?
How to load the variations_id from product_id on form alter in Drupal commerce-2.x?
0
votes
1
answer
95
views
Drupal, invalid arguments supplied for foreach
I'm using Drupal Commerce and when I use some methods (the commerce_fees ones) I have this error :
Warning : Invalid argument supplied for foreach() dans commerce_discount_usage_order_discounts() (...
0
votes
1
answer
2k
views
Drupal 8 Commerce 2: Placing an "Add to Cart" button in a custom product template
I've written a custom Twig product template 'commerce-product.html.twig', which uses fields such as {{product_entity.body.value}} and {{product_entity.field_picture.entity.uri.value}} to pull out ...
2
votes
1
answer
3k
views
ddev start readlink /var/lib/docker/overlay2: invalid argument error
I am trying to install Drupal Commerce via composer. I have finished the installation but it requires DDEV for local development server and it depends on Docker. I installed both and when i try to ...
0
votes
1
answer
1k
views
How to Subscribe to DrupalCommerce 2X Events for every new Order, Product etc is created
I need to be able to write a Plugin that gets the orders, product, etc., whenever a new Order, Product is created in DrupalCommerce 2X. but I can't seem to figure out how Commerce wants me to do it. I ...
1
vote
1
answer
140
views
Drupal rules line items
I'm doing something very simple. I have an order where rules fires on
completed checkout.
I'm trying to iterate through the existing line items and schedule recurring billing based on a text list that ...
1
vote
1
answer
612
views
Cant Install Commerce Checkout Module
I'm in the process of upgrading my website from Drupal 7 to 8 and one of my tasks is to ensure that all modules are copied over and installed.
I've been able to install every 'Commerce' module apart ...
0
votes
1
answer
988
views
Unexpected error when uninstalling drupal 8 commerce
I am trying to uninstall the commerce modules.
I had purchased a template with the commerce modules and using the files with demo data from them. I have contacted the template provider and he has ...
4
votes
1
answer
6k
views
In Drupal 8 Commerce, how to get order id and product variation id from current cart programmatically?
I want to get:
Order ID for the current user;
All product variation ID from the current users cart;
Prices for product variations;
Images;
Titles;
I have the following:
$store_id = 1;
$...
1
vote
1
answer
53
views
Drupal 7 all Users of one role need to be accessible from other role
We are using Drupal Commerce in our website.
We have multiple roles in this website ex. Customer, Customer representative, Content editor and Admin.
Users with "Customer" roles will be allowed ...
1
vote
1
answer
932
views
How to add value to Drupal Commerce 2 order information form?
I am created a Drupal module and added the form alter function:
MY_MODULE_form_alter(&$form, &$form_state, $form_id){
if(($form_id === 'commerce_checkout_flow_multistep_default') &...
0
votes
1
answer
245
views
How "Subscribe to our newsletter" checkbox works for signup newsletter at checkout pages in Drupal
Can anybody tell the workflow of "Subscribe to our newsletter" checkbox at checkout page in Drupal commerce.
Currently i need to sign-up a user for newsletter who has this checkbox checked after ...
1
vote
3
answers
964
views
Can't install drupal 8 commerce checkout module
I'm trying to install drupal 8 commerce checkout module, but I'm getting the error:
Unable to install Commerce Checkout due to unmet dependencies:
core.entity_view_display....
0
votes
1
answer
99
views
Multisite setup on Centos 7 Drupal commerce site
I have requirement of Drupal project which is a commerce website. We have used Drupal commerce module for the same purpose before.
I have Centos 7 as my server with EasyApache installed. Everything ...
0
votes
1
answer
676
views
Commerce rules not showing in Drupal 8
I am currently working on a Drupal8 website where I want to sell user roles. I tried Ubercart with role assignment, but this didn't worked out. I found a tutorial where this was done with Commerce (...
2
votes
3
answers
5k
views
Drupal 8 - Commerce Module - BC math PHP extension not found
I'm trying to install the commerce module in Drupal 8 however I get the error 'BC math PHP extension not found'.
I've searched for this problem and tried different things such as editing the PHP.ini ...
0
votes
1
answer
5k
views
In Drupal 8 Commerce, how to display product variation price in Add to Cart form?
On my Drupal 8 Commerce 8.x-2.0-beta7 site, I cannot get the price of a variation to display in my Add to Cart page.
On my Commerce Products Manage Display page, I am using the "Add to cart form" ...