[Skip to main content](#vessel-content)

#   Link to offsite purchase for certain products

##

- **[dkudler](/forum/user/6616-dkudler "View dkudler's Profile")**
- [![dkudler's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/6616-dkudler "View dkudler's Profile") Topic Author
- [ Offline](/forum/user/6616-dkudler)

Less More

- Posts: 6
- Thank you received: 0
-
-

13 years 4 months ago [\#112406](#112406) by [dkudler](/forum/user/6616-dkudler "View dkudler's Profile")  *[Link to offsite purchase for certain products](/forum/4-how-to/84664-link-to-offsite-purchase-for-certain-products#112406 "At my site (stillpointdigital.com), I have , which can be purchased and downloaded directly from my HikaShop.  I also, however, have that are sold exclusively through Audible.com.  What I am trying to do is figure out a way to change the &quot;Add to Cart&quot; button conditionally. If the product is in the category &quot;Audiobook&quot;, say, I'd love to have the button read &quot;Purchase at Audible&quot; and link to the Audible page (which is already entered as the Brand URL for each product).  Is this possible without completely rewriting the code? If not, can you point me to where in the code I'd need to make changes?")* was created by *[dkudler](/forum/user/6616-dkudler "View dkudler's Profile")*

At my site (stillpointdigital.com), I have [ a shop that mostly sells ebooks](https://stillpointdigital.com/stillpoint-bookstore-2), which can be purchased and downloaded directly from my HikaShop.

I also, however, have [ a number of audiobooks](https://stillpointdigital.com/by-format/category/38-audiobook-mp3) that are sold exclusively through Audible.com.

What I am trying to do is figure out a way to change the "Add to Cart" button conditionally. If the product is in the category "Audiobook", say, I'd love to have the button read "Purchase at Audible" and link to the Audible page (which is already entered as the Brand URL for each product).

Is this possible without completely rewriting the code? If not, can you point me to where in the code I'd need to make changes?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg0NjY0LWxpbmstdG8tb2Zmc2l0ZS1wdXJjaGFzZS1mb3ItY2VydGFpbi1wcm9kdWN0cz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14290
-
-

13 years 4 months ago [\#112425](#112425) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Link to offsite purchase for certain products](/forum/4-how-to/84664-link-to-offsite-purchase-for-certain-products#112425 "At my site (stillpointdigital.com), I have , which can be purchased and downloaded directly from my HikaShop.  I also, however, have that are sold exclusively through Audible.com.  What I am trying to do is figure out a way to change the &quot;Add to Cart&quot; button conditionally. If the product is in the category &quot;Audiobook&quot;, say, I'd love to have the button read &quot;Purchase at Audible&quot; and link to the Audible page (which is already entered as the Brand URL for each product).  Is this possible without completely rewriting the code? If not, can you point me to where in the code I'd need to make changes?")*

You will have to edit the file "quantity" of the view "product" via the menu Display-&gt;Views and add your check at the beginning. Something like that: Code:

&lt;?php if(!empty($this-&gt;row-&gt;product_url)){ echo '&lt;a href="'.$this-&gt;row-&gt;product_url.'"&gt;Add to cart&lt;/a&gt;'; return; } ?&gt;

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg0NjY0LWxpbmstdG8tb2Zmc2l0ZS1wdXJjaGFzZS1mb3ItY2VydGFpbi1wcm9kdWN0cz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[dkudler](/forum/user/6616-dkudler "View dkudler's Profile")**
- [![dkudler's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/6616-dkudler "View dkudler's Profile") Topic Author
- [ Offline](/forum/user/6616-dkudler)

Less More

- Posts: 6
- Thank you received: 0
-
-

13 years 4 months ago [\#112463](#112463) by [dkudler](/forum/user/6616-dkudler "View dkudler's Profile")  Replied by *[dkudler](/forum/user/6616-dkudler "View dkudler's Profile")* on topic *[Link to offsite purchase for certain products](/forum/4-how-to/84664-link-to-offsite-purchase-for-certain-products#112463 "At my site (stillpointdigital.com), I have , which can be purchased and downloaded directly from my HikaShop.  I also, however, have that are sold exclusively through Audible.com.  What I am trying to do is figure out a way to change the &quot;Add to Cart&quot; button conditionally. If the product is in the category &quot;Audiobook&quot;, say, I'd love to have the button read &quot;Purchase at Audible&quot; and link to the Audible page (which is already entered as the Brand URL for each product).  Is this possible without completely rewriting the code? If not, can you point me to where in the code I'd need to make changes?")*

Cool! Thanks!

I take it that the "else" would be an echo containing the button/link I'm looking to add, right?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg0NjY0LWxpbmstdG8tb2Zmc2l0ZS1wdXJjaGFzZS1mb3ItY2VydGFpbi1wcm9kdWN0cz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[dkudler](/forum/user/6616-dkudler "View dkudler's Profile")**
- [![dkudler's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/6616-dkudler "View dkudler's Profile") Topic Author
- [ Offline](/forum/user/6616-dkudler)

Less More

- Posts: 6
- Thank you received: 0
-
-

13 years 4 months ago [\#112464](#112464) by [dkudler](/forum/user/6616-dkudler "View dkudler's Profile")  Replied by *[dkudler](/forum/user/6616-dkudler "View dkudler's Profile")* on topic *[Link to offsite purchase for certain products](/forum/4-how-to/84664-link-to-offsite-purchase-for-certain-products#112464 "At my site (stillpointdigital.com), I have , which can be purchased and downloaded directly from my HikaShop.  I also, however, have that are sold exclusively through Audible.com.  What I am trying to do is figure out a way to change the &quot;Add to Cart&quot; button conditionally. If the product is in the category &quot;Audiobook&quot;, say, I'd love to have the button read &quot;Purchase at Audible&quot; and link to the Audible page (which is already entered as the Brand URL for each product).  Is this possible without completely rewriting the code? If not, can you point me to where in the code I'd need to make changes?")*

Whoops! Missed the ! at the beginning of the check.

I think I've got it. Thanks.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg0NjY0LWxpbmstdG8tb2Zmc2l0ZS1wdXJjaGFzZS1mb3ItY2VydGFpbi1wcm9kdWN0cz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.062 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
