Stack Exchange Network

Stack Exchange network consists of 175 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
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

New answers tagged

0

whats this line is doing? Does it load all active modules in website? It invokes a hook (hook_user_login), which other installed modules can respond to. It doesn't "load" any modules, but those other installed modules are already available at that point, yes. Could I remove this line? Physically, yes, but it would be a terrible idea. It's important, or ...


-1

You should install the commerce properly. here is the reference for what you missed like I did. composer require "drupal/commerce"


0

here is how i achieve to create the user_register_form commerce checkout pane : /** * Implements hook_commerce_checkout_pane_info(). */ function edw_commerce_dc_commerce_checkout_pane_info() { $panes['register'] = [ 'title' => t('Create an account'), 'base' => 'edw_commerce_dc_register_pane', 'name' => t('Authentication'), 'file'...


0

This can be done please see this issue from drupal.org https://www.drupal.org/project/commerce/issues/2935377


1

Any module you distribute must be licensed under the GPL 2.0 or later. You are free to put it up for sale so long as anyone who buys it enjoys the same rights of redistribution - that's just the nature of Drupal's license overall. Anyone who buys your module will be free to put it up on drupal.org and redistribute it at will.


0

As far as I understand you could restrict block from being shown in front page, from block visibility settings. Alternatively, you could also make a custom template for the front page.


0

disable it as discribed by @AddWeb Solution Pvt Ltd. To customize it you could you can clone it. Remove the action that comes with it and use the "Show a message on the site" action instead. Then enable.


1

With the offer types defined in Commerce Discount / Commerce Discount Extra, there isn't much you can do. The closest ones to what you've described are the per-quantity % off discounts, but as you've discovered, you have to specify either a target product or product category. If you're using a taxonomy configuration that allows the per-quantity category ...


0

The commerce_checkout_order_fields will allow you to add extra fields in your checkout process From the module page This can be used to collect additional data during the checkout, for example: - Order comments - Shipping notes - ..


0

Like, such code should work: $product_id = \Drupal::routeMatch()->getRawParameter('commerce_product'); But in my case it is not working. But it work: $paramList = \Drupal::routeMatch()->getRawParameters(); foreach($paramList as $paramName=>$paramVal) { // save params to any variables... }


2

you could do something like this: use Drupal\Core\Form\FormStateInterface; use Symfony\Component\HttpFoundation\RedirectResponse; function MYMODULE_form_alter(&$form, FormStateInterface $form_state, $form_id) { if (strpos($form_id, 'commerce_order_item_add_to_cart_form_commerce_product') !== false) { $form['actions']['submit']['#submit'][] = '...


0

Yes, because Drupal Commerce 2.x and most payment gateway modules tokenize credit card details by default for the sake of reusable "stored payment methods." From a customer experience standpoint, you might want to offer some sort of estimated shipping amount, but so long as you're communicating that shipping costs will be calculated and confirmed with the ...


0

If you are using Drupal 7 - what you are looking for might be module custom_price, or Rules module(maybe with conditional_rules extension). If you are using Drupal 8 - your options are either Rules module or writing a whole custom module that will be intercepting showed and calculated price based on specific rules that you would create.


1

This feature does not exist in core yet but it is in progress right now. Look for it in Commerce 2.13.


0

Based on what I can gather from your question, You could use preprocess_page() hook on the checkout page and load the custom blocks there. This way you can supply some kind of input to the block based on the page content(based on the items in the cart). Then you can change the block content based on the input given to the block.


Top 50 recent answers are included