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.
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:
Go to Advance Settings > Metafield sets in StoreHippo Admin Panel.
Click on Add New to add a new metafield.
Select "ms.products" from the Name field. Provide Name as "external_url" and select Type as "string".
After entering the details, click on the Save button to save the metafield.
<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:
(vuejs themes)<a v-if="product.available && product.metafields.external_url"
:href="product.metafields.external_url" target="_blank"
class="btn btn-primary" >
{{ms.filters.translate('Buy Now')}}
</a>
<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>
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>
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>