Site maintenance: Tuesday 17 Nov, from 10:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Setting Up Categories, Products, Attributes / Custom product type with custom PRODUCT_PRICE_DISCOUNT_PREFIX

Custom product type with custom PRODUCT_PRICE_DISCOUNT_PREFIX

Locked

Started by dbrewster on 18 May 2006, 4:26 PM · Views: 2,803

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
18 May 2006, 4:26 PM
#1
dbrewster avatar

dbrewster

Zen Follower

Join Date:
Jul 2005
Location:
Charlottesville, VA
Posts:
376
Plugin Contributions:
0

Custom product type with custom PRODUCT_PRICE_DISCOUNT_PREFIX

Howdy.

I have successfully created my Document-Register product type, and it's working.

Here's an example, in my sandbox:
http://www.coreknowledge.org/register/index.php?main_page=document_register_info&cPath=40&products_id=137

I'd like to have a custom Specials prefix.

So far:
includes/languages/english/[MY CUSTOM TPL DIR]/english.php

(it seems overrides don't work for that file, so it really resides in includes/languages/english/english.php)

  define('PRODUCT_PRICE_DISCOUNT_PREFIX','Save: ');
  define('DOCUMENT_REGISTER_PRICE_DISCOUNT_PREFIX','Early registration discount: ');

But I am puzzled where to insert that. The only place I find PRODUCT_PRICE_DISCOUNT_PREFIX called is in includes/functions/functions_prices.php by the $show_sale_discount statements.

I suppose I would insert a conditional clause in those, to test for product type, and depending on the test, use my custom discount prefix? Is there an elegant way to do this without mucking up the original functions_prices.php file?

thanks in advance!

---Diana
---signature missing-in-action

18 May 2006, 4:57 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Custom product type with custom PRODUCT_PRICE_DISCOUNT_PREFIX

Pertaining to your english.php folder location...

You posted this as the location
includes/languages/english/[MY CUSTOM TPL DIR]/english.php

and it should be located in:
includes/languages/[MY CUSTOM TPL DIR]/english.php

as there is a classic folder under languages you can place [MY CUSTOM TPL DIR] in this same tree. And as english.php exists directly under language your copy gets placed in [MY CUSTOM TPL DIR] that resides directly under language also.

Try this and you will be pleased.

For the rest you will have to attract a coder

Zen-Venom Get Bitten

18 May 2006, 5:54 PM
#3
dbrewster avatar

dbrewster

Zen Follower

Join Date:
Jul 2005
Location:
Charlottesville, VA
Posts:
376
Plugin Contributions:
0

Re: Custom product type with custom PRODUCT_PRICE_DISCOUNT_PREFIX

kobra:

Pertaining to your english.php folder location...

You posted this as the location
includes/languages/english/[MY CUSTOM TPL DIR]/english.php

and it should be located in:
includes/languages/[MY CUSTOM TPL DIR]/english.php

Ahh, light dawns!

Thanks very much for the correction.