Display specific record number based on selection

6 posts by 4 authors in: Forums > CMS Builder
Last Post: December 10, 2018   (RSS)

By degreesnorth - December 6, 2018

Hi 

How would I add code to the page to SELECT a specific record number based on client requirements.  There are multiple list record pages, one for default, one for club discount prices, one for earlybirds.  I need to insert a specific pricing record in an area depending on the promotional page.  For example, on the club promotion page, it needs to show the club discount prices.  On the normal pages, it needs to display the default prices.  My client may also add more pricing list pages, so it needs to be flexible. I am going around in circles trying to work out how to do this, but ??  Any help would be appreciated.

Thanks

By degreesnorth - December 9, 2018

Unfortunately, a membership plugin won't work, as the visitors haven't regisered when they see a specific promotional page.  It's the promotional page which is what will hopefully get them to register.

I was looking for something which would work like:

1) there is a multi record section with prices.  One for default, one for Club discounts, one for x, one for y, one for z (etc).  The client can create these records as they require them.

2) there is a multi record section with promotional pages.  The client can create these records as required.  

3) On a specific promotional page (the default is the normal register page with normal prices).  The client can select which pricing table they want to use.  It could be the default pricing, or it could be Club discounts, or it could be Prices X or Prices Y.   I'd like the client to be able to select which pricing table, as they don't have access to the backend/FTP, ie, it needs to be automated.

Is this possible?

Thanks

Carole

By Toledoh - December 9, 2018

Hi Carol - definately possible.

I would add an additional field to the promotional-pages section, called "price" which is a list that pulls from the "prices" section.

The prices section would have a title and value field, where the title is "Club Discount" etc, and the value is "99.00" for $99.00 etc.

Then, in the page php, use the value of the price field in the form.

Cheers,

Tim (toledoh.com.au)

By degreesnorth - December 9, 2018

Thank you...   I've done that, but can't work out how to get, for example, price record 2 on promotional page 1 or price record 5 on promotional page 4.I'm sure it's a "where = etc", but I can't work out the code snippet.

Any advice would be gratefully appreciated.


Thank you

By daniel - December 10, 2018

Hi Carole,

A simple way to retrieve a specific record based on its num field, you can use the mysql_get() function like this:

$pricingRecord = mysql_get('pricing', $pricingNum);

You will need to alter this for your specific case; the first argument 'pricing' is the table name of the pricing section, and $pricingNum will be the record number you're trying to select.

Let me know if that helps, or if you have any further questions.

Thanks,

Daniel
Technical Lead
interactivetools.com