Welcome Guest! To enable all features please try to register or login.
Options
Go to last post Go to first unread
Offline Dlarryb  
#1 Posted : Tuesday, December 10, 2019 10:24:41 AM(UTC)
Dlarryb

Rank: Newbie

Reputation:

Groups: Registered, Registered Users, Subscribers
Joined: 5/17/2019(UTC)
Posts: 0

Was thanked: 2 time(s) in 1 post(s)
Is there a way to add a product that will link to another website without adding it to the cart?
Offline Will Strohl  
#2 Posted : Tuesday, December 10, 2019 10:55:59 AM(UTC)
Will Strohl

Rank: Administration

Reputation:

Groups: Administrators, HCC-Employee-Store-Manager, HCC-Employee-Support, HCC-Partner, Moderators, Partners, Registered, Registered Users, Subscribers
Joined: 12/22/2016(UTC)
Posts: 342
United States

Thanks: 78 times
Was thanked: 59 time(s) in 57 post(s)
What do you mean by "a product that will link to another website?"
Will Strohl, Upendo Ventures
Hotcakes Cloud | Get Support | Code Support
Official Cloud & Support provider for Hotcakes
Offline Dlarryb  
#3 Posted : Tuesday, December 10, 2019 11:02:07 AM(UTC)
Dlarryb

Rank: Newbie

Reputation:

Groups: Registered, Registered Users, Subscribers
Joined: 5/17/2019(UTC)
Posts: 0

Was thanked: 2 time(s) in 1 post(s)
I have affiliate agreements with a couple of different e-commerce websites and would like to list products from those sites. What I would like to do is enter all of the product information so that the products are indexed on my site. Subsequently, I would like to display the product to customers and then provide a link that they would click on to view/purchase the product from the respective e-commerce website.
Offline Will Strohl  
#4 Posted : Tuesday, December 10, 2019 11:16:47 AM(UTC)
Will Strohl

Rank: Administration

Reputation:

Groups: Administrators, HCC-Employee-Store-Manager, HCC-Employee-Support, HCC-Partner, Moderators, Partners, Registered, Registered Users, Subscribers
Joined: 12/22/2016(UTC)
Posts: 342
United States

Thanks: 78 times
Was thanked: 59 time(s) in 57 post(s)
Ah... Now I know what you mean. :)

I have a future project where I may doing that very same thing. What I plan on doing for those products is setting them up using Product Types and Product Type Properties.

https://hotcakescommerce.../210466763-Product-Types
https://hotcakescommerce...-Product-Type-Properties

A product type property you'd add would be Text. For products that link out to other websites, you'd look for this property and then replace the Add to Cart button with a Buy on Other Website button using that value. This also allows for stores where you have a mix of local and off-site products. Alternatively, you can check for that value and show no button (and/or e-mail yourself in case you missed a product type value).

https://hotcakescommerce...-Product-Type-Properties
Will Strohl, Upendo Ventures
Hotcakes Cloud | Get Support | Code Support
Official Cloud & Support provider for Hotcakes
Offline Dlarryb  
#5 Posted : Tuesday, December 10, 2019 11:26:22 AM(UTC)
Dlarryb

Rank: Newbie

Reputation:

Groups: Registered, Registered Users, Subscribers
Joined: 5/17/2019(UTC)
Posts: 0

Was thanked: 2 time(s) in 1 post(s)
Thank you very much. I had a feeling that product types would be my starting point. I assume that you use js or jquery to replace the Add to cart button?
Offline Dlarryb  
#6 Posted : Tuesday, December 10, 2019 4:24:51 PM(UTC)
Dlarryb

Rank: Newbie

Reputation:

Groups: Registered, Registered Users, Subscribers
Joined: 5/17/2019(UTC)
Posts: 0

Was thanked: 2 time(s) in 1 post(s)
I got it working. My goal was to replace the Add to Cart with a button that would take a user to an external website to purchase the product. I also wanted to load an external image as the product image.

Here are the steps that I took:

1. Created a Property type with name of my external website.
2. Created a Property type Property called "External URL:"
3. Created a Property type Property called "Image URL:"
4. Created the product and added the external URL and Image URL.

I then added the following script to the PropertyViewerView.ascx file:

<script type="text/javascript">
$(window).on('load', function() {
if ($('.hc-typedisplay')[0]) {
$('.hc-typedisplay').hide();
var u = $('.hc-typedisplay span').text().replace('External URL:', '');
var ar = u.split('Image URL:');
var uhtml = '<li><a href="' + ar[0] + '" target="_blank" class="dnnPrimaryAction">Purchase Options</li>';
$("meta[property='og:image']").attr('content', ar[1]);
$('#hcProductImage').attr('src',ar[1]);
$('#hcProductActions').html(uhtml);

}
});
</script>

Notes:
1. The script first checks to see if Property Type Properties are present. If they are, it proceeds. If you use additional Property Type Properties for other purposes, you will need to be more specific in your validation.

2. There is no way to collect each Property Type Property individually. I opted to use the hc-typedisplay class to collect the Property Type Properties. I could have drilled down to hc-propertyvalue class but both values are concatenated upon collection and thus I did not have a delimiter to split.

3. Upon collecting the Property Type Properties, I then use the External URL to replace the Add to Cart button with a button styled link. I then use the Image URL to replace the "missing" product image src.

4. I am using Hotcakes under DNN and thus I am using the dnnPrimaryAction class to display my link as a button.

5. Obviously the script will need to be re-inserted if Hotcakes is updated.
thanks 2 users thanked Dlarryb for this useful post.
Will Strohl on 12/12/2019(UTC), Reto Cossalter on 1/7/2020(UTC)
Offline Will Strohl  
#7 Posted : Thursday, December 12, 2019 3:16:07 PM(UTC)
Will Strohl

Rank: Administration

Reputation:

Groups: Administrators, HCC-Employee-Store-Manager, HCC-Employee-Support, HCC-Partner, Moderators, Partners, Registered, Registered Users, Subscribers
Joined: 12/22/2016(UTC)
Posts: 342
United States

Thanks: 78 times
Was thanked: 59 time(s) in 57 post(s)
Thanks for the updates. This looks really good. Personally, I think it would be better to replace the button with Razor instead of JS though. :) Well done!
Will Strohl, Upendo Ventures
Hotcakes Cloud | Get Support | Code Support
Official Cloud & Support provider for Hotcakes
Offline Will Strohl  
#8 Posted : Thursday, December 12, 2019 3:17:36 PM(UTC)
Will Strohl

Rank: Administration

Reputation:

Groups: Administrators, HCC-Employee-Store-Manager, HCC-Employee-Support, HCC-Partner, Moderators, Partners, Registered, Registered Users, Subscribers
Joined: 12/22/2016(UTC)
Posts: 342
United States

Thanks: 78 times
Was thanked: 59 time(s) in 57 post(s)
Oh, one more thing... If you're concerned about changes and scripts being overwritten during upgrades, then you're probably not using a custom viewset. It sounds like you're making updates in the default viewset. You should instead create and maintain your own custom viewset instead. :)

https://hotcakescommerce...Creating-Custom-Viewsets
Will Strohl, Upendo Ventures
Hotcakes Cloud | Get Support | Code Support
Official Cloud & Support provider for Hotcakes
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.303 seconds.

Notification

Icon
Error

Loading
  • Sign-up for the Hotcakes Community Newsletter: