We’re rewarding the question askers & reputations are being recalculated! Read more.

New answers tagged

0

You need to create an empty product and use entity.form_builder service to generate the form. Try the following. <?php namespace Drupal\mymodule\Controller; use Drupal\commerce_product\Entity\Product; use Drupal\Core\Controller\ControllerBase; class HelloController extends ControllerBase { public function content() { $product = Product::create([ ...


2

Instead of unsetting the #value property (which works, but I find it personally counter-intuitive), you could try setting it by using the form_type_image_button_value() function. As an example: function my_custom_module_form_views_form_commerce_cart_form_default_alter(&$form, &$form_state, $form_id) { if (!empty($form['edit_delete'])) { ...


4

You need to unset the #value on your image_buttons: $item['#type']='image_button'; $item['#src']='sites/all/themes/mytheme/images/trash.svg'; $item['#alt']='Remove'; unset($item['#value']); // this line here The line item that is deleted is determined by the #triggering_element in your $form_data. This element is determined by a function ...


0

I fixed it by Updating Drupal Commerce module.


0

Commerce Currency Settings module changes the Currency format sitewide. I recommend using the: Price formatter: Raw amount, exclude it from display Global: Math expression, e.g. [commerce_price]/100 (Drupal commerce often uses the minor unit: pennies etc.) Global: Custom text, e.g. R[expression] This will allow you to use Views to display as you wish in ...


Top 50 recent answers are included