Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 04-21-2005 23:21:25

grapefix
Member
Registered: 12-01-2004
Posts: 73
Website

Product Accessories Linked To A Popup Window

I want to offer the customer a chance to add a helpful tool or two while their choosing their product. This is in the form of a linked popup to a category of tools that offers the 'add-to-cart' for each product listing, but no product detail link. Quick and easy.

So I put together a MOD (I guess) but have come to a problem. Here's a short version of how I did this and what's wrong:

Made new category with 'popup' in it's ref i.d.

Put 2 products in it with 'popup' in their product i.d.

Made a new site layout that is bare bones for a popup window - that's called only when a REF includes /popup/ (modified the ste_exec.pl)

Modified the ste_cart.pl (######### This routine adds items to the user's shopping cart.) to call the 'confirm' page instead of the 'cart' page when the REF includes /popup/

AND it all works! ....except...

... The only way I'm able to get the 'confirm' page to be the response is if I call up the entire 'ste_exec_element' in the popup layout -- I don't want all the tracking and category string links that come along with this! When I just call in the ste_cat page items (minus the ste_exec_storehead portion) It looks exactly as I want, but I get a blank page in the popup window after submitting -- that can't be good.

I've worked feverishly...since I don't even know anything about perl...how can I get this last bit to work out?

I've included the link for testing in this product's description (try and see). This is with the 'ste_exec_element' - that I don't want - being used:



Any help or ideas for this are welcome. BTW I tried a user page for this and couldn't get it to add to the customer's cart. I don't know how to get the customer's variables to transfer in and out. Maybe that would work better if I knew how.

Offline

 

#2 04-22-2005 14:31:16

0_limit
Member
Registered: 05-19-2004
Posts: 12
Website

Re: Product Accessories Linked To A Popup Window

From what I can see it should work fine. All your doing is opening up a new page that contains a set category and the products under that category. Your already passing the variables through the URL under your tools() function.

One quick way around your store header printing is to have the ste_exec_storehead only print if the 'popup' string is not in ref variable (i.e. if ($fd_ref ne "popup")). Just surround the ste_exec_storehead code in the 'IF' statement. I'm not sure what your code looks like so I can't give specifics.

Removing the ste_exec_storehead from your 'ste_cat' page isn't feasable because it would remove that element from all Category pages..not just your popup (Unless you don't want it).

Also when you get a blank page sometimes it may have an error code printed in the source by CCP.

Last thing that may help is some tips on passing variables. CCP already has a lot of pre-made variables that pass variables. The are all located in the VARS.PL script that is in the folder 'Common' located in your 'cgi-bin/library/' directory. There are two ways to pass the variables. Either through a form ($common_hidden_fields in VARS.PL) or through a URL ($common_url in VARS.PL). Any variables that you add to the VARS.PL file are global so if you add a new variable to $common_url variable it will always be passed when you call common_url in your page layouts or in your scripts. The same goes for forms. You can submit the value through a form and then have it passed through a "hidden" input.

Don't know if that helps but it may give you some ideas.

Offline

 

#3 04-22-2005 15:39:28

grapefix
Member
Registered: 12-01-2004
Posts: 73
Website

Re: Product Accessories Linked To A Popup Window

Good information... But I'm still looking for the reason that using the 'ste_exec_element' in my popup layout works and returns the right 'confirm' page that I asked for - - while not using the 'ste_exec_element' returns a blank page (probably an error). I don't know where to begin fixing this, since I don't want the ste_exec_element stuff in the popup.

Do you suppose I need to find all of the prints in the ste_exec.pl  and turn them off when there's a 'popup' ref? Like I did with the other perls commands? That sounds like more work than it should be.

Allen

Offline

 

#4 04-23-2005 11:37:04

0_limit
Member
Registered: 05-19-2004
Posts: 12
Website

Re: Product Accessories Linked To A Popup Window

The 'ste_exec_element' does just as it describes. It executes the elements of the page such as the header, layout, contents etc. Without that function it wouldn't be able to execute or print the elements resulting in a blank page. It seems like all you want to do is prevent CCP from printing the 'ste_strhd_trk' or 'ste_strhd_notrk' elements. All you should have to do is modify 'ste_exec_storehead' in your ste_exec.pl file with your IF statement which would prevent CCP from printing the heading links on your popup page. Everything else should be ok and shouldn't have to be modified.

Offline

 

#5 04-24-2005 15:51:36

grapefix
Member
Registered: 12-01-2004
Posts: 73
Website

Re: Product Accessories Linked To A Popup Window

Thanks. Didn't work, but it's probably my fault.

I created a new ste_strhd_ppup that includes center tags only and tried to call it up in the following manner in the ste_exec.pl. I received a script error when going to the site. Am I missing some semantics?

Code:

#########
######### This routine displays the store heading for navigation
######### purposes.  It has two option - with or without order
######### tracking.
#########

if ($store_use_order_tracking eq "Y"){ 

&display_print('ste_strhd_trk');

if ($fd_ref =~ /popup/){ 

&display_print('ste_strhd_ppup');

} else {

&display_print('ste_strhd_notrk');

} ######### End of if statement.

/popup/ being the reference included in the category and product i.d.'s.

I think the problem here may be that the "tracking-Yes" is true already so the fd_ref cannot be part of the statement since there's no further variables available. Perhaps I need a statement before this saying if ref=popup then ste_strhd_ppup and otherwise ask Yes or No to the order tracking question. Is there an easier way?

Thanks for any help!

Offline

 

#6 04-26-2005 11:22:42

0_limit
Member
Registered: 05-19-2004
Posts: 12
Website

Re: Product Accessories Linked To A Popup Window

Try this out:

Code:


#########
######### This routine displays the store heading for navigation
######### purposes.  It has two option - with or without order
######### tracking.
#########

if ($fd_ref =~ /popup/){ 

&display_print('ste_strhd_ppup');

} else {

if ($store_use_order_tracking eq "Y"){ 

&display_print('ste_strhd_trk');

} else {

&display_print('ste_strhd_notrk');

} ######### End of if statement.

} ######### End of if statement.

What it is saying is that if $fd_ref equals '/popup/' then print the 'ste_strhd_ppup' element and if it doesn't then continue with the routine as it normally does.

Offline

 

#7 04-27-2005 09:30:32

grapefix
Member
Registered: 12-01-2004
Posts: 73
Website

Re: Product Accessories Linked To A Popup Window

That looks promising. I will try it out. Thanks!

Offline

 

#8 04-28-2005 14:08:04

grapefix
Member
Registered: 12-01-2004
Posts: 73
Website

Re: Product Accessories Linked To A Popup Window

Thanks 0_limit!! That really did the trick.

Now for the kicker...

I have links turned on in my shopping cart. So if someone clicks to view the product detail from their shopping cart of this 'popup'-added item, ccp uses the ste_ppup_hd as I've directed it and now the whole site looks like a popup layout with my 'close window' link. I would like it to be a normal product detail page coming out of the cart link.

That doesn't seem possible with the 'popup' references calling up the ste_strhd_ppup so I tried working on getting the ste_cart.pl to create a link as a javascript popup to the product detail when the reference is a /popup/ in the product, like this:

Code:

$cart_linkopen = "";
$cart_linkclose = "";

####### MY ADDITION

if ($fd_ref =~ /popup/) {

$cart_linkopen = "<A HREF=\"javascript:tool-($cart_prodid)()\">";
$cart_linkclose = "</A>";

} else {

####### END OF MY ADDITION

if ($store_cart_links eq "Y" && $cart_url ne "") {

Another quirk. The javascript popup code that's inserted in the head of the ste_layout for this will have to include specific instances for each product. I tried adding just one and then none worked. So I left the ste_layout with only the original js popup in the head and then edited the ste_exec.pl to call a different layout for the shopping cart, called ste_cart_layout, and including the js code for one of the products in the head, like this:

Code:

<script>
function tool-popup_squeegie-small(){
   window.open ('(CGIVAR)common_url(/CGIVAR)&pg=prod&ref=popup_squeegie-small&cat=popupacc1&catstr=', 'tool-popup_squeegie-small', config='height=640, width=480, toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, directories=no, status=no');
}
</script>

I guess I've missed something because the cart's product link for the popup item shows no change and doesn't refer to the javascript popup.

I was really excited that it's worked so well up to this point. But I just can't turn off the links in the shopping cart - they are so important to the customer. Ugh!

Thanks for any help.

Offline

 

#9 04-30-2005 15:06:12

grapefix
Member
Registered: 12-01-2004
Posts: 73
Website

Re: Product Accessories Linked To A Popup Window

O.K., ignore the previous post. I've worked long and hard and got everything to work completely UP TO the 1st page of the checkout, where the itemization of the products turns into just a subtotal amount. At this page, the product that's added through the popup still gets listed with it's shopping cart layout.

Try it out here, by using the "See a list" link:

Please help if anyone has ideas on this.

Here's how I modified the ste_cart.pl:

Added some popup variables that are used by a new 'ste_popup_prodlink' cart display in the middle of this:

Code:

$cart_linkopen = "";
$cart_linkclose = "";

if ($store_cart_links eq "Y" && $cart_url ne "") {

$cart_linkopen = "<A HREF=\"$cart_url\">";
$cart_linkclose = "</A>";

$popup_prod_url = "$common_url&pg=prod&ref=$cart_prodid_encoded&cat=$cart_cat_encoded&catstr=$cart_catstr_encoded";
$popup_width = (500);
$popup_height = (640);

} elsif ($store_cart_links eq "Y" && $cart_prodid ne "") {

Added this to call up the cart display for a popup detail on these items (first 3 lines are mine):

Code:

if ($cart_prodid =~ /ppp/) {

&display_print('ste_popup_prodlink');

} else {

if ($param eq "U") {

if ($recur_found eq "Y") {

&display_print('ste_cart_contur');

As far as the new cart display ('ste_popup_prodlink'), I only modified the link portion to bring in the popup variables, following the extra-large image format.

I'm guessing that it's something very important that I've excluded when the /ppp/ is used. I'm also guessing I'll never find it on my own.

I'd be more than willing to post the complete mod here if I can get it to work.

Any help?

Offline

 

#10 05-03-2005 07:15:08

0_limit
Member
Registered: 05-19-2004
Posts: 12
Website

Re: Product Accessories Linked To A Popup Window

When you add an item through the popup window do you want it to show up in the cart the default way where the link takes you to the product page or do you want the link to point to the popup window? You'll have to set some variables either way but they are different for each instance.

Offline

 

#11 05-03-2005 10:27:49

grapefix
Member
Registered: 12-01-2004
Posts: 73
Website

Re: Product Accessories Linked To A Popup Window

0_limit, thanks so much for helping! I don't know if you've looked into the product link I posted, but this works just as I want it to up until the 'checkout' button is clicked.

Products are added at the requested quanitity from a category listing in a popup and a 'thank you' is returned (I used the confirm page). The popup window is closed and their main window remains undisturbed.

Now if I can only get the checkout page to stop listing the product as if it's the cart page.

Offline

 

#12 05-03-2005 13:07:00

0_limit
Member
Registered: 05-19-2004
Posts: 12
Website

Re: Product Accessories Linked To A Popup Window

Its hard to tell exactly what you've got going on with the code because I can't see it all but maybe if you change your code to this it will solve the problem.

Code:

if ($cart_prodid =~ /ppp/ && $param ne "C") {

&display_print('ste_popup_prodlink');

} else {

if ($param eq "U") {

if ($recur_found eq "Y") {

&display_print('ste_cart_contur');

Let me know if it works smile

Offline

 

#13 05-03-2005 14:16:54

grapefix
Member
Registered: 12-01-2004
Posts: 73
Website

Re: Product Accessories Linked To A Popup Window

Ahhh....sweet nector of success! That, my friend, did the trick.

I've got some work ahead to implement the whole thing and all the products and I'll be making a 'sister' category of products sans the popup references for normal shopping. But I'm very happy with this result.

Thanks 0_limit!

I would be happy to share this with the forum if someone can tell me the process or if it's allowed. Look at any of the 'apeels' product details on my website wwwgraphicspackages.com to see the popup product link for TOOLS just above the options.

Thanks again!

Allen

Offline

 

Board footer