Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
 All Forums
 Technical
 Tips and Tricks - HALL OF FAME
 Change a parameter for one product
Author « Topic »  

dbdave
ECT Moderator

USA
10266 Posts

Posted - 02/07/2015 :  11:14:16  
THIS IS FOR .ASP
Here is a handy tip if you want to change a parameter setting for just one product without creating a static page.
I did this for a few products that needed smaller thumbnail images using magic tools

In my includes, I have a setting for that.
thumbnailstyle="height:70px;padding:3px;"

But for one product that has quite a few thumbnail images, I wanted to make them smaller.
In my proddetail.asp page, just before the include line,
quote:
<!--#include file="vsadmin/inc/incproddetail.asp"-->


I added
quote:

<%If Request.QueryString("prod") = "MY-PRODUCT-ID" Then
thumbnailstyle="height:40px;padding:1px;"
End If%>


But you can also do other things with it.
Lets say you wanted to hide the price on just that product
quote:

<%If Request.QueryString("prod") = "MY-PRODUCT-ID" Then
noprice=true
End If%>


If you have several products that you need to modify, you can write it like this
quote:

<%If Request.QueryString("prod") = "XYZ123" Then
thumbnailstyle="height:40px;padding:1px;"
ElseIf Request.QueryString("prod") = "ABC321" Then
noprice=true
End If%>



You could really use any languagefile or parameter changes using that.

Happy selling...


David
ECT Power User :)

Edited by - dbdave on 02/07/2015 12:28:02

dbdave
ECT Moderator

USA
10266 Posts

Posted - 02/07/2015 :  12:31:59  
If you wanted to change some css for just one product you can add this in the head of the page.

This example, I am using the category page.
categories.asp

quote:
<style type="text/css">
<% If Request.QueryString("cat") = "widgets" Then
Response.Write("div.category{ height: 155px;}@media screen and (max-width: 980px) { img.catimage{ height: 100px; max-width: 115px;}")
End If %>
</style>


David
ECT Power User :)

dbdave
ECT Moderator

USA
10266 Posts

Posted - 02/07/2015 :  13:05:17  
Ok, just one more and I am done for today - I promise.

Lets say you want to put a message on a page if it comes from a specific link or referral.

In this case, I am using the partner because it's a nice way to track a sale, even if you are not using it for the affiliate program.

In this case, I want to show a message on my Category page if a visit comes from a newsletter I sent out.

In my categories.asp page, before my include line, I add the following

quote:
<%If Request.QueryString("partner") = "newsletter2015" Then
Response.Write "Thanks for responding to our special offer, be sure to use code - 10off to get your special discount"
End If%>


Then in my newsletter, I will have created a link like so
http://www.mysite.com/categories.asp?cat=widgets&partner=newsletter2015

When the reader clicks the link, that message will show on the page.
However, to a regular site visitor, that message will not show
Using the affiliate program, you will have created an affiliate ID of newsletter2015 and then you can track exactly how much revenue you generated from that link as well.

If you don't want to use the affiliate "partner" thing, you can really make up just about anything as a parameter, and it will just be ignored by your store if it's unique.

For example, let's say I sell race car parts, and I participate in a message forum when I have a link in my signature on that forum
http://www.mysite.com/categories.asp?cat=racewidgets&linkfrom=raceforum

Then in my categories.asp page, I might have
quote:
<%If Request.QueryString("linkfrom") = "raceforum" Then
Response.Write "Thanks for visiting my website from the Racing Forum and here is that special offer just for my friends blah blah blah"
End If%>


By adding "&linkfrom=raceforum" to my url, that message is triggered to show.


David
ECT Power User :)

Edited by - dbdave on 02/07/2015 13:09:20

Andy
ECT Moderator

95440 Posts

Posted - 02/07/2015 :  15:23:02  
Thanks for the tips David, I'll make this a sticky as that's going to be very handy.

Andy

Please feel free to review / rate our software

dbdave
ECT Moderator

USA
10266 Posts

Posted - 02/07/2015 :  18:16:08  
For those using the .asp version with URL rewrite, I don't think my tricks above will work.
Although I have not tested it, this should do the trick.

quote:

<%If Request.ServerVariables("PATH_INFO") = "/Blue_Widgets" Then
Response.Write "Some Message Here"
End If%>




Basically everything after the .com including the slash would need to be used where I have /Blue_Widgets in my example above.

For PHP users, this shouldn't be too difficult to convert.
To be clear, I am not a coder by any means. I just speak just enough "computereze" to be able to understand "some of it" LOL



David
ECT Power User :)

Edited by - dbdave on 02/07/2015 18:33:08

atlend
Advanced Member

USA
319 Posts

Pre-sales questions only
(More Details...)

Posted - 04/29/2015 :  12:29:33  
David, thanks for the idea! Does anyone know what the language would be to do this in PHP?

Thanks,
Chris

dbdave
ECT Moderator

USA
10266 Posts

Posted - 04/29/2015 :  22:19:54  
Some time searching around and I could likely figure it out.
I am guessing it's an easy task for someone with .php knowledge.
Some searching I just did looks like in place of Request.QueryString("prod") , you would use something like $_GET['prod']

One problem for me is I don't actually have the .php version so I can't test this.
ok, ok, Actually to be correct, I could test by creating a basic .php page, but it's a lot of work for someone like me with such little coding knowledge.

Hopefully someone will come along and offer the solution.
If I get frisky in the future when I have more time, I will see if I can come up with it.

David
ECT Power User :)

dbdave
ECT Moderator

USA
10266 Posts

Posted - 04/29/2015 :  23:28:50  
Ok, so this just kept nagging at me so I did some more searching and borrowed some info from this ( http://php.net/manual/en/reserved.variables.get.php ) page to come up with the following

quote:
<?php
if($_GET["cat"] === "123") echo "Output some text on the page";
?>



So my previous post where I posted this in .asp
quote:
<%If Request.QueryString("partner") = "newsletter2015" Then
Response.Write "Thanks for responding to our special offer, be sure to use code - 10off to get your special discount"
End If%>

the .php equivalent would be

quote:
<?php
if($_GET["partner"] === "newsletter2015") echo "Thanks for responding to our special offer, be sure to use code - 10off to get your special discount";
?>


David
ECT Power User :)

Edited by - dbdave on 04/29/2015 23:29:55

atlend
Advanced Member

USA
319 Posts

Pre-sales questions only
(More Details...)

Posted - 04/30/2015 :  09:15:35  
Thanks, David!

dbdave
ECT Moderator

USA
10266 Posts

Posted - 08/11/2015 :  22:02:24  
Vince posted some .php code that is along the same lines as my tip - so for the .php folks here is the link
http://www.ecommercetemplates.com/support/topic.asp?TOPIC_ID=102722

David
ECT Power User :)
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.03 seconds. Snitz Forums 2000