drupal-commerce

How to make the address code on one line with TWIG?

半腔热情 提交于 2020-01-25 07:58:08
问题 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>': ' - '})|striptags|raw }} 回答1: Your are outputting the address inside a <pre> tag. The white-space of the <pre> tag is set to pre by default. See here for more information about this. So you have 2 options Replace the <pre> tag with a <div> <div> Lorem ipsum dolor sit amet </div> Overrule the white-space of

Can't install drupal 8 commerce checkout module

人走茶凉 提交于 2019-12-24 12:20:03
问题 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.commerce_product_variation.default.summary (commerce_product.commerce_product_variation_type.default) I can't find the problem, what it could be and how to fix it? 回答1: It looks like we have a soft-dependency issue on Commerce Product. Please install Commerce Product first. This is an issue due to the default checkout

Drupal Commerce Order object extra data

ぐ巨炮叔叔 提交于 2019-12-24 00:53:44
问题 How might it be possible to get Commerce-Product-Display information in a Commerce-Order object? The issue is I need to publish a Commerce-Product-Display node when a user has made a payment to publish the node. I am using Rules to detect the payment and attempt to publish the node. My problem is, because the Completing the checkout process Rules event only has data for a Commerce-Order, and the Commerce-Order does not have information for the Product nor the Product display, I am unable to

How to Subscribe to DrupalCommerce 2X Events for every new Order, Product etc is created

别等时光非礼了梦想. 提交于 2019-12-11 14:24:03
问题 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 don't see any *events files that would give me the data. It looks like Commerce wants me to create a separate Event Flow plugin that would add the step I want, but I can't seem to find documentation about implementing my own Event Flow. Can you guide me to the right path of running my code when

Drupal Commerce Line Items: alter the price?

坚强是说给别人听的谎言 提交于 2019-12-03 06:10:05
问题 I have to add to my cart some line items with a custom amount. The commerce product is saved with price = 0, and my module compute the price and add the line item to the cart/order, but i dont understand how to set programmatically the price. I've read about using Rules, but I need my module to be able to set/alter the price, without invoking rules . I've tryed with an entity wrapper, i tryed to alter the line item created with commerce_product_line_item_new(), but nothing, when the line item

Drupal Commerce Line Items: alter the price?

寵の児 提交于 2019-12-02 19:35:22
I have to add to my cart some line items with a custom amount. The commerce product is saved with price = 0, and my module compute the price and add the line item to the cart/order, but i dont understand how to set programmatically the price. I've read about using Rules, but I need my module to be able to set/alter the price, without invoking rules . I've tryed with an entity wrapper, i tryed to alter the line item created with commerce_product_line_item_new(), but nothing, when the line item gets into the cart always has the original product price (in my case, 0). How to alter a line item