Page 1 of 1

add a link to sub store on product page for multistores

Posted: Sat Jul 12, 2014 4:45 am
by Lef
After spending the whole day in front of the computer :crazy: finally found the solution :o

well it goes like this :

Bear in mind I ran a multistore based on subdomains.

I used the location field to enter the sub store web address i.e. http://subdomain.domain.com

Then in catalog-->controller-->product-->product.php
find

Code: Select all

$this->data['points'] = $product_info['points'];
and under that put

Code: Select all

/* Lef 11.07.2014 -- load location for store link use */
          $this->data['location'] = $product_info['location'];
          /* end Lef 11.07.2014 */
this is to load the web address from the location field

after go to catalog-->view-->your theme-->template-->product-->product.tpl and find

Code: Select all

<span><?php echo $text_stock; ?></span> <?php echo $stock; ?></div>
and change it to

Code: Select all

<span><?php echo $text_stock; ?></span> <?php echo $stock; ?><br />
 <!-- Lef 11.07.2014 show store link -->
<span id="store_link"><?php echo "<a href=$location>$text_store_link</a>" ?></span></div>
afterwards create a text variable in your language(s) folder
catalog-->language-->your language-->product-->product.php

Code: Select all

// Lef 11.07.2014 text used for store link
$_['text_store_link']   = 'Visit Store';
and load that in catalog-->controller-->product-->product.php
find the line

Code: Select all

$this->data['text_tags'] = $this->language->get('text_tags');
and under it put

Code: Select all

$this->data['text_store_link'] = $this->language->get('text_store_link');
finaly in your theme stylesheet.css
catalog-->view-->your theme-->stylesheet-->stylesheet.css put at the end

Code: Select all

#store_link  a {
	font-size: 14px;
	font-style: bold;
	color: navy;
}
and your done ... ENJOY :P

p.s. now someone make it show only on default store :) I am tired
p.s.2 just checked and because I use a different theme in substores than the default store it does not appear :) If you use the same you have to make it not appear.