Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

How to get public wishlist id without sending an email?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-29-2010, 09:55 PM
 
TheWrongGrape TheWrongGrape is offline
 

Advanced Member
  
Join Date: Nov 2002
Location: Los Angeles, CA
Posts: 68
 

Default How to get public wishlist id without sending an email?

Hello,

Does anyone know how to get the public wish list URL without having to send an email? I want customers to be able to just copy and paste the URL to send via IM or to post to Facebook and Twitter, etc.

I haven't been able to figure it out. I know the URL ends with /cart.php?mode=friend_wl&wlid={something here}

I tried $wlid but that didn't work. Any help would be appreciated!

Thanks.
Reply With Quote
  #2  
Old 05-31-2010, 10:05 PM
 
TheWrongGrape TheWrongGrape is offline
 

Advanced Member
  
Join Date: Nov 2002
Location: Los Angeles, CA
Posts: 68
 

Default Re: How to get public wishlist id without sending an email?

I was able to solve this myself. Here's the solution in case anybody wants to do the same in 4.3.1:

In skin1/modules/Wishlist/wl_products.tpl add at the bottom after the form for sending the Wish List:
Code:
{if $login ne ""}Your public Wish List URL:<br/> {$http_location}/cart.php?mode=friend_wl&wlid={php} $wishlistid = $this->_tpl_vars[login]; echo md5($wishlistid); {/php}

There may be a cleaner way to get that but it works for me as is.
Reply With Quote
  #3  
Old 06-01-2010, 12:54 AM
 
successco successco is offline
 

Advanced Member
  
Join Date: Apr 2005
Location: Washington USA
Posts: 42
 

Default Re: How to get public wishlist id without sending an email?

Well I thought this was a great idea & tried it in my x-cart version, works, good! Only one issue & I want to make sure it's just me... or not. When you visit the x-cart URL http://www.website.com/a/cart.php?mode=friend_wl&wlid=4a537c1ed8e512c09bd9e 2c130a02100 (example only) and you see the wishlist, do you see an "Add to Cart" button? or just the "Details" button?

I would think it would be best to see the "Add to Cart" button whether the visiting friend is logged in or not (which of course they probably wouldn't be logged in since they just clicked that public URL).

Now I do have the setting for view product details before adding to cart checked (but I cannot find where to change that setting yet). However, I don't even know if that would have an impact on the "Add to Cart" button showing on this public wishlist URL any way, because by looking at the code from the include called ( File: /modules/Wishlist/wl_buttons.tpl ) on ( File: /modules/Wishlist/wl_products.tpl ) the section where the "Add to Cart" button would be displayed or not shows:

PHP Code:
{if (($wl_products and $wl_products[product].amount_purchased $wl_products[product].amount and $wl_products[product].avail gt "0") or $config.General.unlimited_products eq "Y") or $main_mode eq "manager" or $buttons_for eq "giftcerts" or $wl_products[product].product_type eq "C"}
{if 
$login}
{if 
$giftregistry eq ""}
<
td class="ButtonsRow">{include file="buttons/add_to_cart.tpl" href="cart.php?mode=wl2cart&wlitem=`$wlitem_data.wishlistid`"}</td>
{else}
<
td class="ButtonsRow">{include file="buttons/add_to_cart.tpl" href="cart.php?mode=wl2cart&fwlitem=`$wlitem_data.wishlistid`&eventid=`$eventid`"}</td>
{/if}
{/if}
{else}
{if 
$wl_products[product].amount $wl_products[product].avail}
<
td class="ButtonsRow"><b>{$lng.txt_out_of_stock}</b></td>
{/if}
{/if} 

if $login and if $giftregistry eq ""

before it's deciding to show the "Add to Cart" button or not...


Of course I'm going to play around a bit with it & see if I can get it to show without being logged in, just wondering are you seeing the "Add to Cart" button on your x-cart version? I know mine is different. Thanks for your post & reply, it's a neat & good idea.
__________________
X-cart Gold 4.1.6
X-affiliate 4.1.6
Reply With Quote
  #4  
Old 06-01-2010, 02:08 AM
 
successco successco is offline
 

Advanced Member
  
Join Date: Apr 2005
Location: Washington USA
Posts: 42
 

Default Re: How to get public wishlist id without sending an email?

The add to cart button shows just fine for visitors viewing a friend's wish list, after the $login was commented out, like:
PHP Code:
{* START ADD TO CART BUTTONS *}
{* if 
$login *}{* HID IF LOGIN SO USER OR VISITOR CAN STILL ADD TO CART EVEN WHEN NOT LOGGED IN *}
{if 
$giftregistry eq ""}
<
td class="ButtonsRow">{include file="buttons/add_to_cart.tpl" href="cart.php?mode=wl2cart&wlitem=`$wlitem_data.wishlistid`"}</td>
{else}
<
td class="ButtonsRow">{include file="buttons/add_to_cart.tpl" href="cart.php?mode=wl2cart&fwlitem=`$wlitem_data.wishlistid`&eventid=`$eventid`"}</td>
{/if}
{* /if *}{* 
HID CLOSING IF LOGIN SO USER OR VISITOR CAN STILL ADD TO CART EVEN WHEN NOT LOGGED IN *}
{* 
END ADD TO CART BUTTONS *} 

But of course now there's another issue... the URL that the wishlist is on is not httpS:// it's just http:// . Should be https:// since it's in the cart.php & that should be secure (at least in my store). So changing:
PHP Code:
{if $login ne ""}Your public Wish List URL:<br/>
{
$http_location}/cart.php?mode=friend_wl&wlid={php}
$wishlistid $this->_tpl_vars[login];
echo 
md5($wishlistid);
{/
php

to:

PHP Code:
{if $login ne ""}Your public Wish List URL:<br/>
{
$https_location}/cart.php?mode=friend_wl&wlid={php}
$wishlistid $this->_tpl_vars[login];
echo 
md5($wishlistid);
{/
php

for secure https:// url.


The final version I used is:
PHP Code:
{* START WISHLIST URL DISPLAY *}
{if 
$login ne ""}
<
strong>You can share your own Wish List URL anywhere:</strong>
<
br />
{
$https_location}/cart.php?mode=friend_wl&wlid={php}
$wishlistid $this->_tpl_vars[login];
echo 
md5($wishlistid);
{/
php}
<
br />
<
br />
You can copy &amplink to your own Wish List URL anywhere:
<
textarea rows="2" cols="110">

{
$https_location}/cart.php?mode=friend_wl&wlid={php}
$wishlistid $this->_tpl_vars[login];
echo 
md5($wishlistid);
{/
php}
</
textarea>
<
br />
<
br />

or 
by using the following pre-made HTML

<
textarea rows="2" cols="110"><A HREF="{$https_location}/cart.php?mode=friend_wl&wlid={php}$wishlistid = $this->_tpl_vars[login];
echo md5(
$wishlistid);
{/php}"
>My Wish List</A>
</
textarea>
<
br />
<
br />

{/if}
{* 
END WISHLIST URL DISPLAY *} 
__________________
X-cart Gold 4.1.6
X-affiliate 4.1.6
Reply With Quote
  #5  
Old 06-03-2010, 02:46 PM
 
TheWrongGrape TheWrongGrape is offline
 

Advanced Member
  
Join Date: Nov 2002
Location: Los Angeles, CA
Posts: 68
 

Default Re: How to get public wishlist id without sending an email?

Glad you figured it out. I am using X-Cart for a site that doesn't really sell anything - I link to a lot of affiliate products and the "Wish List" feature is for my users to save a list of their favorite items for later browsing or to share with friends. Along with having the public URL visible, I also have a Post to MySpace and Post to Facebook buttons next to it:

Code:
<!-- ### BEGIN MYSPACE ### --> <form id="myspacepostto" method="post" action="http://www.myspace.com/index.cfm?fuseaction=postto" target="_blank" style="display: inline; padding: 0; margin: 0;"> <input type="hidden" name="t" value="REPLACE WITH TITLE OF LINK AKA My Wishlist at Fake Store" /> <input type="hidden" name="c" value="REPACE WITH DESCRIPTION AKA Just a few of my favorite items at Fake Store" /> <input type="hidden" name="u" value="{$http_location}OR{$https_location}/cart.php?mode=friend_wl&wlid={php} $wishlistid = $this->_tpl_vars[login]; echo md5($wishlistid); {/php}" /> <input type="hidden" name="l" value="3" /> <a style="cursor: pointer;" onclick="document.getElementById('myspacepostto').submit();" title="Share on MySpace"> <img src="LINK TO YOUR MYSPACE ICON" alt="MySpace" /></a></form>&nbsp; <!-- ### BEGIN FACEBOOK ### --> <a href="http://www.facebook.com/sharer.php?u={$http_location}OR{$https_location}/cart.php?mode=friend_wl&wlid={php} $wishlistid = $this->_tpl_vars[login]; echo md5($wishlistid); {/php}&t=REPLACE WITH A TITLE" target="_blank" title="Share on Facebook"> <img src="LINK TO YOUR FACEBOOK ICON" alt="Facebook" /></a>
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:34 PM.

   

 
X-Cart forums © 2001-2020