Code in product boxes |
Post Reply | Page 12> |
Author | |
GreggS
Groupie Joined: 06-February-2012 Location: New Jersey Status: Offline Points: 60 |
Post Options
Thanks(0)
Posted: 23-October-2012 at 12:58pm |
This might be a simple thing.
I just found out you can put code into some of the boxes when modifying a product not just the long description. For example some things are special order so we check Not For Sale and add this to the message: Please call or <a href=contact.asp>contact</a> us to check for availability and ordering In the short description we added a picture instead of text. <br><a href=http://www.1st-line.com/store/pc/configurePrd.asp?idproduct=5287><img src="test-sale.jpg"></a><br><br> We're trying to add code that has an "if" statement. When we put that in, it displays text not code. We tried adding around the code - quotes, brackets, <body> - but it still reads as text. |
|
Guests
Guest |
Post Options
Thanks(0)
|
Hi Gregg,
It reads as text because it is text. You can't store server-side code in the db and expect it to execute because the server side code executes before pulling the textual content from the db. You could inject client-side code such as HTML, JavaScript, etc., but not server-side code.
|
|
GreggS
Groupie Joined: 06-February-2012 Location: New Jersey Status: Offline Points: 60 |
Post Options
Thanks(0)
|
Thanks. I had a feeling it wouldn't work. I just won a bet :)
|
|
Guests
Guest |
Post Options
Thanks(0)
|
Glad you won some dig there ... but back to the UI issue you are trying to solve. It's possible that the condition your trying to hedge against could be handled with client side code (esp. with the magic of AJAX).
Want to explain exactly what you're trying to accomplish here? I'm all ears.
|
|
GreggS
Groupie Joined: 06-February-2012 Location: New Jersey Status: Offline Points: 60 |
Post Options
Thanks(0)
|
It's part of our BTO scenario. I posted a long description of our (complex) scenario somewhere but I can't find it. On some Standard Products, we put a link(which is a picture) in the short description which goes straight to a BTO Product configuration page. We have custom code for BTO to prevent going to the configuration page if all items in a required category are out of stock. It didn't give a message or anything it just went to the BTO Product detail page and if you try to hit the Customize button again it goes to the config page and back to the detail page in the blink of an eye. Customers would probably think the button is broken. So what my boss tried to do is copy the "if" statement code that displays the Availability: Out of Stock and use that code in the short description.
---If Availability is out of stock ---> don't show the link ---else ---> show the link I told him I don't think that would work. He bet me and I won. |
|
whizzinpc
Newbie Joined: 17-January-2006 Location: California Status: Offline Points: 20 |
Post Options
Thanks(0)
|
I'm pretty sure that's possible. You just have to do it directly in the asp code.
|
|
Guests
Guest |
Post Options
Thanks(0)
|
Hi Gregg,
Could you post us an example link? A picture being worth a thousand words? If you need this embedded somewhere in the middle of the description (rather than before or after it, in which case Art is correct), I might be able to come up with a client-side option for you.
|
|
GreggS
Groupie Joined: 06-February-2012 Location: New Jersey Status: Offline Points: 60 |
Post Options
Thanks(0)
|
We have a workaround that we might be able to live with. Originally we had BTO Products visible and the Standard Products in a hidden category. Now we flipped it and the BTO Products are in the hidden category.
Here is an example of an item that is in stock. http://www.1st-line.com/store/pc/Bezzera-Strega-Commercial-Espresso-Machine-switchable-tank-direct-connect-A107-126p4422.htm The item is a Standard Product. The picture in the short description points to the BTO Product configuration page. Here is an example of an item that is out of stock. http://www.1st-line.com/store/pc/ECM-Germany-Barista-Commercial-Espresso-Machine-tank-C104-127p10.htm The out of stock message shows up but the BTO link is still there. With the custom code, since the required category doesn't have an item underneath that has stock, it redirects to the BTO Product details page; and because it's in a hidden category you get that "error" page. We also reworded the page and put a back link in there. This is something we can live with. Taking it to the next step would be to hide the link or replace the link with a message like "No Package Deals Available At This Time." If it's something simple to add that would be great, but if we had to change multiple files we would rather not. This could be up for debate. Looking at it from a customer's point of view and not a ProductCart point of view, does this current setup look unappealing, where you see a big button leading to a Special Sale only to be redirected to another page that says there is no sale? Or do you think it's implied enough that there wouldn't be a sale when there is a message underneath that says Out Of Stock? The out of stock button does show up in search results. http://www.1st-line.com/store/pc/showsearchresults.asp?pageStyle2=H&resultCnt2=15&keyword=ECMG88074&submit=Go |
|
Guests
Guest |
Post Options
Thanks(0)
|
Hi Gregg,
Thanks for this. I can see that the "Package Deal" button is outside of the content of the short description. It should be very easy to make the not show when the "Notify Me" button shows -- even easier if we put them in the same place. I'll have Kelly take a look at this and at the "Notify Me" button not showing on the search results page.
|
|
GreggS
Groupie Joined: 06-February-2012 Location: New Jersey Status: Offline Points: 60 |
Post Options
Thanks(0)
|
The Notify Me stuff works ok. The button does show up on the search results page. I'm pretty sure I put the code that shows the "package deal" button in the short description
Inside the short desciption box. <br><a href=http://www.1st-line.com/store/pc/configurePrd.asp?idproduct=4627><img src="http://www.1st-line.com/store/pc/catalog/misc/package-deal.jpg"></a><br><br> |
|
Post Reply | Page 12> |
Tweet
|
Forum Jump | Forum Permissions 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 |