Helpcenter +918010117117 //cdn1.storehippo.com/s/573db3149f0d58741f0cc63b/ms.settings/5256837ccc4abf1d39000001/57614ef64256dc6851749879-480x480.png" support@storehippo.com https://www.facebook.com/StoreHippohttps://twitter.com/StoreHippohttps://www.linkedin.com/company/hippoinnovations/https://plus.google.com/+Storehippo/posts
B4,309-10 Spaze iTech Park, Sector 49, Sohna Road, 122001 Gurgaon India
call to replace anchor tags contains '/admin' in href

How to redirect your product to another store?

Scenario

You want certain products to list on your store and available for sale on some another store or marketplace. You want your product to redirect to another store on the click on the Buy Now button. 

Steps

If you want products to list on your store but sold at another store, you can do so by redirecting your products to another store. You can redirect to another store by clicking on the Buy Now button to buy the same product from another page.

To add an external link, follow the below steps:

  1. Go to Advance Settings > Metafield sets in StoreHippo Admin Panel.

  2. Click on Add New to add a new metafield.

  3. Select "ms.products" from the Name field. Provide Name as "external_url" and select Type as "string".

  4. After entering the details, click on the Save button to save the metafield.

  5. Now, go to Products > Products section in the StoreHippo Admin Panel.
  6. Edit/add a product, and you will find the metafield named "External Url". Here you can provide the link where you want to redirect the product for checkout.
  7. Click on Save to save the changes.
  8. Go to Design theme from StoreHippo Admin Panel.
  9. Open the Product on which you want redirection. Hover on it and click on the "Product" as shown below.
  10. In the product code, find the "Buy Now" code snippet and replace the following code with the new code given below.

    Old Code:
    <a data-ng-if="ms.variables.show_buynow_option=='yes'&& product.available"
       class="btn btn-primary btn-lg ms-br-zero ms-mr-xs buy-now"
       data-ng-click="data.buynow=1;check_required_options(product,quantity);"
       title="{{'Buy Now'|msTranslate}}"> {{'Buy Now'|msTranslate}}</a>

    New Code:

    <a data-ng-if="ms.variables.show_buynow_option=='yes' && product.available && product.metafields.external_url"
       href="{{product.metafields.external_url}}" target="_blank"
       class="btn btn-primary btn-lg ms-br-zero ms-mr-xs buy-now"
       title="{{'Buy Now'|msTranslate}}"> {{'Buy Now'|msTranslate}}</a>
    
    <a data-ng-if="ms.variables.show_buynow_option=='yes'&& product.available && !product.metafields.external_url"
       class="btn btn-primary btn-lg ms-br-zero ms-mr-xs buy-now"
       data-ng-click="data.buynow=1;check_required_options(product,quantity);"
       title="{{'Buy Now'|msTranslate}}"> {{'Buy Now'|msTranslate}}</a>

  11. To remove the Add to Cart button from your product page, you are required to replace the "Add to Cart" code to the following code:

    Old Code:

    <a data-ng-if="product.available"
       class="btn btn-primary btn-lg ms-br-zero ms-mr-xs add-cart"
       data-ng-click="check_required_options(product,quantity)"
       title="{{'Add to Cart'|msTranslate}}">
        {{'Add to Cart'|msTranslate}}</a>

    New Code:

    <a data-ng-if="product.available  && !product.metafields.external_url"
       class="btn btn-primary btn-lg ms-br-zero ms-mr-xs add-cart"
       data-ng-click="check_required_options(product,quantity)"
       title="{{'Add to Cart'|msTranslate}}">
        {{'Add to Cart'|msTranslate}}</a>

  12. In case, if you want to add the redirection link to the Add to cart button, then replace the following code with the new code given below.

    Old Code:

    <a data-ng-if="product.available"
       class="btn btn-primary btn-lg ms-br-zero ms-mr-xs add-cart"
       data-ng-click="check_required_options(product,quantity)"
       title="{{'Add to Cart'|msTranslate}}">
        {{'Add to Cart'|msTranslate}}</a>

    New Code:

    <a
     class="btn btn-primary btn-lg ms-br-zero ms-mr-xs add-cart"
     href="{{product.metafields.external_url}}" target="_blank"
     data-ng-if="product.available"
     title="{{'Add to Cart'|msTranslate}}">
     {{'Add to Cart'|msTranslate}}</a>
                                                  
    <a 
     data-ng-if="product.available  && !product.metafields.external_url"
     class="btn btn-primary btn-lg ms-br-zero ms-mr-xs add-cart"
     data-ng-click="check_required_options(product,quantity)"
     title="{{'Add to Cart'|msTranslate}}">
     {{'Add to Cart'|msTranslate}}</a>
  13. When you have replaced the above codes, your product page will appear as shown below and clicking on Buy Now button will redirect you to another page.
2020-08-17T10:22:00.626Z