This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Temporarily changing $route_match to a node path

I have some code that runs on an admin page controller. So if I do $route_match = \Drupal::routeMatch(); then it relates to that admin page. However, I want to Temporarily change the value of \Drupal::routeMatch() so that it uses the path of a node (for example node/1).

With Drupal 7 I could simply change $_GET['q'] = 'node/1', for example, do my logic and switch it back to the original path afterwards.

How to display the rendered entity of a store in a modal window ?

I created a module for my marketplace (several stores and owners). It displays a required checkbox, in the purchase funnel. With a link to the general conditions of sale which are rendered in a modal window.

This module works perfectly.

MY PROBLEM :

I no longer want to display the CGV page in the modal window.

I want to display the rendered entity of the store with the CGV display mode.

Can you reply with the correct code ? Thank you

How do I flag a store when an input method is used ?

Here is my full code.

  1. I want to automatically flag the store with the payment_gateways flag when the commerce_store_payment_gateways_form form is submitted.

  2. I want to automatically flag the store with the shipping_methods flag when the commerce_store_shipping_methods_form form is submitted.

I tested this code and it doesn't work for stores :

How to split results from view by taxonomy term?

Hello. I have a view with several elements and a panel with filters. Each element is associated with a taxonomy term (and only one). I want to make a view where items are grouped into categories. It should look like a heading and elements below it. About the same as done in VISA (https://developer.visa.com/apibrowser). How can i do this? I realized that I couldn't just copy views with different categories, because then the filters would stop working.

Custom content type not available in Simpletest

Hi all,

I have been trying to develop tests for a custom module of mine using the Simpletest module (Drupal 7.73 installation). I can't seem to access a custom content type I have created within my module.

How to display the rendered entity of a store in the purchase funnel ?

I created a link that displays the "Terms and Conditions" of the store to which the shopping cart relates in a modal window.

This link a page in a modal window.

I want to replace the page rendered by the store's rendered entity with the cgv display mode (this is the machine name of the display mode in my store type).

What should I change in my code ?

my_module/src/Plugin/Commerce/CheckoutPane/MarketplaceTermsAndConditions.php :

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions