Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 VP-Cart 8.00 Issues
 Inserting price into the description
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

FCS-Webmaster
VP-CART New User

Canada
117 Posts

Posted - June 07 2018 :  12:55:17  Show Profile  Visit FCS-Webmaster's Homepage  Reply with Quote
In past versions of VPASP I was able to use [cprice] to insert the price into the description for the sales copy of a product. It had the advantage that if the price of the item was changed then as the web page pulling it from the database the web page would not require any updating. Any suggestions on how to do that in version 8?

I already have tried [formatcurrency cprice] but it doesn''t work in the description.

manilow
VP-CART New User

France
123 Posts

Posted - June 07 2018 :  16:14:31  Show Profile  Visit manilow's Homepage  Reply with Quote
Do you mean you inserted previously [cprice] in the text editor in shopa_addproduct.asp ? That would not work since keywords between square brackets are processed in the template before the field data is retrieved from the database, and so is the text in the product descriptions. Keywords between brackets can only be included in the templates.

Erik
www.aquathermia.com (vpasp7)
Go to Top of Page

Alex123
VP-CART New User

USA
171 Posts

Posted - June 07 2018 :  16:24:19  Show Profile  Reply with Quote
The format [formatcurrency cprice] should be working in Version 8 too as per the doc.

https://helpnotes.vpcart.com/userguide800/#!Documents/templatefunctions.htm

Have you tried [FORMATCUSTOMERPRICE cprice]

Alex
Go to Top of Page

FCS-Webmaster
VP-CART New User

Canada
117 Posts

Posted - June 07 2018 :  17:13:52  Show Profile  Visit FCS-Webmaster's Homepage  Reply with Quote
Manilow what you say makes sense, but has me wondering why it worked in previous versions. Yes I did mean in the shopa_addproduct.asp product editor.

Hi Alex. I just tried your suggestion and as you can see here it https://www.fcsurplus.ca/shopping/products/467950-amp-tactical-half-face-mask/ it didn''t process the text.
Go to Top of Page

manilow
VP-CART New User

France
123 Posts

Posted - June 07 2018 :  17:27:36  Show Profile  Visit manilow's Homepage  Reply with Quote
I''m not really sure about what you would like to achieve by including the price in the sales copy of a product. Wouldn''t it be appropriate if you add the cprice field somewhere in your product template near the description field?
Go to Top of Page

FCS-Webmaster
VP-CART New User

Canada
117 Posts

Posted - June 07 2018 :  17:36:50  Show Profile  Visit FCS-Webmaster's Homepage  Reply with Quote
Manilow, to clarify we are selling on the product page a protective mask for your mouth that in the sport of airsoft people shoot BBs at you. The players in this sport frequently get teeth chipped as people are shooting small BBs at them.

I want to add the price of the mask to the line ...
Dentists in London currently charge $1000 to $1500 for a cap on a chipped tooth. At only [FORMATCUSTOMERPRICE cprice] our masks are a lot cheaper!

I''m worried that if I change the template to achieve this change it will have an impact on the other 2500 products we have in our VPASP cart.
Go to Top of Page

diegomilito
VP-CART Expert

Argentina
766 Posts

Posted - June 07 2018 :  21:56:55  Show Profile  Reply with Quote
im reading your post and what you want, actually you can set some products you want to use their own template

in add or editing product (im talking about vpasp admin area) , under Advanced Fields , you get to see what it called "Template File (template)", just create the new template for your certain products maybe call it tmp_product_mask.htm

what i m suggesting this, so that it will not affecting to all other products.

diego.
Go to Top of Page

manilow
VP-CART New User

France
123 Posts

Posted - June 08 2018 :  03:50:37  Show Profile  Visit manilow's Homepage  Reply with Quote
FCS-Webmaster thanks for your explanations which make it very clear to me. There is a way to achieve this but you have to modify some code.

Go to shopprotabs.asp, around line 94, add the following lines in green:

case "xproductextdesc"
''701 - 2011.04.19 - Enhancement: Speed enhancement fixes
fieldvalue = parseRS("extendeddesc")

transvalue=TranslateLanguage(dbc, "products", "extendeddesc","catalogid", parsers("catalogid"), fieldvalue)
htmlwrite "<br />"
''code modification : allow cprice field in extended product description
if instr(transvalue,"[cprice]")>0 or instr(transvalue,"& #91;cprice& #93;")>0 then
dim descprice
descprice = HandleCustomerPrice(parsers("cprice"), parsearray, parseRS)
transvalue=replace(transvalue,"[cprice]",descprice)
transvalue=replace(transvalue,"& #91;cprice& #93;",descprice)
end if

htmlwrite transvalue

This should work without affecting other products. You may have to add some lines if you want taxes to be included. Remove the spaces between & and #91/#93 which were needed for display on the forum.

Regards.
Go to Top of Page

apswater
VP-CART Super User

443 Posts

Posted - June 08 2018 :  14:23:33  Show Profile  Visit apswater's Homepage  Reply with Quote
I would think you can just use the Template Listing field listed on the edit page for the product and make a different template for those products. That seems the easiest way.

Although I do like Manilows approach. Also be careful the tick marks convert to quote marks on this forum. tick marks for comments and quotes for code.

Edited by - apswater on June 08 2018 14:27:28
Go to Top of Page

Alex123
VP-CART New User

USA
171 Posts

Posted - June 08 2018 :  15:13:07  Show Profile  Reply with Quote
As diegomilito mentioned the template option should be working for you.
Alex
Go to Top of Page

apswater
VP-CART Super User

443 Posts

Posted - June 08 2018 :  15:22:30  Show Profile  Visit apswater's Homepage  Reply with Quote
opps, i replied before i read diegos...


Mitch
https://www.apswater.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00