I only know that getProductUrl() ?> is calling "http://b2b.com/product1/" But how to call a dynamic URL key in the /product/view.phtml, so then in the URL structure only the domain is changed from b2b.com to b2c.com but the product key will stay the same according to which product is being viewed?
If the site is setup with the proper store scopes, native magento will handle this for you through the
function. You should confirm the base_url is set properly for both store scopes.
I have no idea if this will work for you, but hopefully this will get you in the right direction.
To get the
URL key you should use
$product->getUrlPath(); If the url is http:://b2b.com/product1 it will give you 'product1'
Okay, I found a solution that is exactly what I want to achieve:
<a href="http://google.com/<?php $_product = Mage::getModel('catalog/product')->load($_product->getId()) ?><?php echo $_product->getUrlKey(); ?>">ProductName</a>
Then the URL link will be shown as google.com/ProductName