Receiving payments with woo commerce

I have a site https://mastoorabeauty.com
I encountered a problem with paypal as they have limited my account asking for photo I'd after months of booking disputes or issues.
Long story short I want to know if there is a way to recieve paypal payments without my paypal account?
I have read there is a few options but I'm not savvy with this
I use stripe at the moment which is fine but have had multiple orders in the past 3 days saying something about not honouring the payment
Which is very…

Receiving payments with woo commerce

Upgrade from Open Source to Commerce Error

  • I am upgrading Magento 2.3.1 Community Edition to Magento 2.3.1 Enterprise Edition.
  • All these prerequisites are done ✅
  • By Upgrade from the Magento Admin it do not give option of Eneterprise Edition in the list, it is only CE.
  • By following Command line Upgrade, it stucks when I execute:

    composer require magento/product-enterprise-edition=2.3.2 --no-update 

    and prompts this error message:

[InvalidArgumentException]
Could not find a matching version of package magento/product-enterprise-edition. Check the package spelling, your version con straint and that the package is available in a stability which matches your minimum-stability (stable).

Looking for help from a legendary developer, because the issue has not been solved by many developers like me.

Upgrade from Open Source to Commerce Error

  • I am upgrading Magento 2.3.1 Community Edition to Magento 2.3.1 Enterprise Edition.
  • All these prerequisites are done ✅
  • By Upgrade from the Magento Admin it do not give option of Eneterprise Edition in the list, it is only CE.
  • By following Command line Upgrade, it stucks when I execute:

    composer require magento/product-enterprise-edition=2.3.2 --no-update 

    and prompts this error message:

[InvalidArgumentException]
Could not find a matching version of package magento/product-enterprise-edition. Check the package spelling, your version con straint and that the package is available in a stability which matches your minimum-stability (stable).

Looking for help from a legendary developer, because the issue has not been solved by many developers like me.

Handling anonymous orders in custom commerce module

Drupal: 8.7.2 Commerce: 2.13

I have a custom module set up that adds the following functionality to Commerce:

  1. It prevents the user from adding more than one item to their cart. If they try to add a second item, it removes the first item from their cart and adds the second item.

  2. When clicking “Add to Cart”, it redirects the user to a confirmation page.

  3. On that page is a button that links to the order’s checkout page.

I am handling all of these via queries that use the user ID and order ID to pull the correct order/cart information.

This all works great for logged in users. Most of our customers will be anonymous, though. It does work for anonymous users, but my concern is that if multiple anonymous users are placing orders at the same time, their carts will get mixed up, because all anonymous users have a UID of 0.

How can I better differentiate between anonymous user’s carts? Is there a way to store their IP in the database, and then use that?

Here is my module’s code:

commerce_custom.module (handles removing first item from cart, redirecting to confirmation page):

<?php   use Drupal\Core\Form\FormStateInterface; use Drupal\commerce_order\Entity\Order; use Symfony\Component\HttpFoundation\RedirectResponse;  /**  * Implements hook_form_FORM_ID_alter().  */ function commerce_custom_form_commerce_order_item_add_to_cart_form_alter(&$  form, FormStateInterface $  form_state, $  form_id) {    $  form['actions']['submit']['#value']='Sponsor';    $  form['#validate'][] = 'commerce_custom_form_validate';    $  form['actions']['submit']['#submit'][] = 'commerce_custom_cart_alter_redirect'; }  function commerce_custom_form_validate(array &$  form, FormStateInterface $  form_state) {      $  user = \Drupal::currentUser()->id();     $  connection = \Drupal::database();     $  query = $  connection->query("select * from commerce_order_item join commerce_order on commerce_order_item.order_id = commerce_order.order_id where uid = :user and state = 'draft'", [':user' => $  user]);     $  result = $  query->fetchAll();     //dpm($  result);      $  cart_count = $  result[0]->quantity;     $  order_id = $  result[0]->order_id;      if ($  cart_count > 0 && $  order_id) {         $  order = \Drupal::entityTypeManager()->getStorage('commerce_order')->load($  order_id);         $  items = $  order->getItems();         foreach($  items as $  item_key => $  item) {             $  order->removeItem($  item);             $  item->delete();         }     } }  function commerce_custom_cart_alter_redirect(&$  form, FormStateInterface $  form_state) {   $  responce =  new RedirectResponse('/how-it-works');   $  responce->send(); } 

ContinueCheckoutBlock.php (creates block with button linking to checkout page):

<?php  namespace Drupal\commerce_custom\Plugin\Block; use Drupal\Core\Block\BlockBase;  class ContinueCheckoutBlock extends BlockBase {     public function build() {          $  user = \Drupal::currentUser()->id();         $  connection = \Drupal::database();         $  query = $  connection->query("select * from commerce_order_item join commerce_order on commerce_order_item.order_id = commerce_order.order_id where uid = :user and state = 'draft'", [':user' => $  user]);         $  result = $  query->fetchAll();         $  order_id = $  result[0]->order_id;          return array(             '#type' =>'markup',             '#markup' => '<a href=checkout/' . $  order_id . '/order_information class=button>Continue</a>',         );    } } 

Drupal Commerce 2 Receipt Email only shows Billing and Shipping data when an order is placed as an admin user

I have triple checked all the User Permissions on admin/people/permissions. All checked permissions for under Commerce are checked with the exception of those that have the “Warning: Give to trusted roles only; this permission has security implications.” warning.

I replaced the custom commerce-order-receipt.html.twig with the original one used in Commerce2 with no luck as well.

Any further debugging tips and suggestions are helpful as I am newer to the Drupal world. Thank you!

How to mix preset amounts and a user entered amount in commerce

I am implementing donations functionality with Drupal commerce 2.x

I have found a patch that allows for a direct checkout form (kind of “buy now” button) https://www.drupal.org/project/commerce/issues/2810723

I also want to present the user with a set of predefined options ($ 100, $ 200 plus some text for each option).

I am using product variations for this where each option is one variation.

I also want to have one option that allows to specify a custom amount. So if the variations were checkboxes or a drop down then there should be one option that says “Custom amount..”. When this is selected the user should enter the amount (there should be a field to store this on the order_item entity right?)

I’ve looked at commerce_donate (8.x) which I think is based on Bojanz’ donation example https://github.com/bojanz/donation_example

The question is it possible to mix fixed amounts (as variations) and custom amounts by using different order item types? I was thinking one order item type that is product variation based and one that is without purchasable entity type. Is that the way to go or will it cause problems down the line? I guess “all” I have to do is implement a custom form similar to the one in donate_example and toggle based on the custom value.

Finally, I’m not so worried about frontend – it would be nice if it worked in principle with Drupal forms API but I’ll be implementing this in some fancy JS framework so I care more about architecture and editor experience.

Commerce 2.x custom checkout pane for order comments not saving

I’ve created a custom checkout pane for commerce 2.x, Drupal version 8.7.x. I’ve added a textfield called field_order_notes on the order entity. The pane works, and I can run $ this->order->set('field_order_notes', $ values) in my pane’s submit handler, and I can debug the order object and see the value’s set. But when i finish the order, field_order_notes is empty on the order. Not sure what I’m missing here.

 /**  * Adds a section for order notes.  *  * @CommerceCheckoutPane(  *   id = "order_notes",  *   label = @Translation("Order notes"),  *   default_step = "order_information",  * )  */ class OrderNotes extends CheckoutPaneBase implements CheckoutPaneInterface {   /**    * The inline form manager.    *    * @var \Drupal\commerce\InlineFormManager    */   protected $  inlineFormManager;   /**    * {@inheritdoc}    */   public function __construct(array $  configuration, $  plugin_id, $  plugin_definition, CheckoutFlowInterface $  checkout_flow, EntityTypeManagerInterface $  entity_type_manager) {     parent::__construct($  configuration, $  plugin_id, $  plugin_definition, $  checkout_flow, $  entity_type_manager);   }   /**    * {@inheritdoc}    */   public function buildPaneForm(array $  pane_form, FormStateInterface $  form_state, array &$  complete_form) {     $  pane_form['order_notes'] = [       '#type' => 'textarea',       '#title' => $  this->t('Order notes'),       '#default_value' => $  this->order->get('field_order_notes')->getString(),       '#required' => FALSE,     ];     return $  pane_form;   }   /**    * {@inheritdoc}    */   public function submitPaneForm(array &$  pane_form, FormStateInterface $  form_state, array &$  complete_form) {     $  values = $  form_state->getValue($  pane_form['#parents']);     $  this->order->set('field_order_notes', $  values);   } } 

Commerce Order receipt email html stripped

I’m using Drupal 8.7.3 with Commerce 2.

When the order process is completed, the receipt email is sent but html tags are stripped.

The email has “content-type text/html; charset=UTF-8;”.

Key Value content-transfer-encoding   8Bit content-type    text/html; charset=UTF-8; date    Tue, 18 Jun 2019 23:39:22 +0000 from    "Linux User" <www-data@localhost> mime-version    1.0 received    by localhost (sSMTP sendmail emulation); Tue, 18 Jun 2019 23:39:22 +0000 sender  don@test.com subject Order #2 confirmed to  don@test.com x-mailer    Drupal