Product url/ add carts get_permalink – Domain Mapping Issue
-
Hi folks,
is there anyway to change the way woocommerce generate the product urls/ add cart link? In my case on gutenberg woo blocks (I think the same url generating function effects products on category shop page as well). As far as I understand, it is the function “get_permalink()“.
The case:
I use a Domain Mapping Plugin (https://de.www.ads-software.com/plugins/multiple-domain-mapping-on-single-site/) – One WordPress Installation/ Different Domains pointing Pages etc, for example “www.heumoederntrails.de” belongs to page “Trails”, “www.heimatrausch.de” is the url wp is installed, “www.heimatrausch.de/shop” the woocommere shop base.
I use the standard (integrated) woocommerce gutenberg blocks on several pages with the intention to display the products there > link to the shop (https://woocommerce.com/products/woocommerce-gutenberg-products-block/). In the backend: https://www.dropbox.com/s/wcjvw7zgyr7scu3/screenshot%202019-09-18%2022.08.00%282%29.png?dl=0.
So I display product blocks on the page belonging the domain, in this case “www.heumoederntrails.de”. The woocommerce shop, installed on the same wordpress installation has the domain “www.heimatrausch.de” eg. in this case the product permalink should be “www.heimatrausch.de/produkt/heumoederntrails-crowdfunding-dein-support-sticker/”.
BUT: The product blocks diplayed on the page “www.heumoederntrails.de” generate the LINK and the ADD CART Url from the actual domain, here “www.heumoederntrails.de” and NOT from the shop domain “www.heimatrausch.de”, I guess by using the function “get_permalink()”.
-> Product link should be RIGHT: https://www.heimatrausch.de/produkt/heumoederntrails-crowdfunding-dein-support-sticker/
-> Product link generated WRONG: https://www.heumoederntrails.de/produkt/heumoederntrails-crowdfunding-dein-support-sticker/Any suggestions to change the url base for the generated product links/ add cart buttons in the gutenberg block view (think its the same as products shown in shop category? Perhaps to home_url or site_url function?
Thank you!
The page I need help with: [log in to see the link]
- The topic ‘Product url/ add carts get_permalink – Domain Mapping Issue’ is closed to new replies.