Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Add 2 custom fields to Quiz
(1 viewing) (1) Guest
component
Go to bottomPage: 1
TOPIC: Add 2 custom fields to Quiz
#42616
Add 2 custom fields to Quiz 10 Years, 12 Months ago Karma: 0
Hi there,

I wish to add 2 custom fields to each Quizzes. (2 prices) as we will charge for access to each quiz.

Is there a best practice to add 2 fields, rather than adding them manually to the database and hacking the AriQuiz core code? Is there a plugin perhaps? I am currently using a join table but things could get out of synch..

thanks,
Pete
The administrator has disabled public write access.
 
#42617
Re:Add 2 custom fields to Quiz 10 Years, 12 Months ago Karma: 748
Hello,

Do you need separate fields in "ariquiz" table or is it suitable if new fields will be stored in JSON format in "ExtraData" field from "ariquiz" table?

Regards,
ARI Soft
The administrator has disabled public write access.
 
#42618
Re:Add 2 custom fields to Quiz 10 Years, 12 Months ago Karma: 0
Hmm - good question..

I would prefer to have separate fields of course,maybe with a plugin to add access to them via teh Quiz Edit interface (a new tab?)...

..but I guess I could make do with JSON if it made the idea possible, and kept the core code safe from hacking..

I don't need to filter or sort by the prices in SQL, but I do need to know which price is which, so "{"rrp":200,"discount":150}" would work..

How would I allow the customer access to that data in the interface though?

I would assume the JSON options would pop up under Additional Settings ?

Thanks
Pete
Last Edit: 2013/07/11 11:12 By xmanflash.
The administrator has disabled public write access.
 
#42620
Re:Add 2 custom fields to Quiz 10 Years, 12 Months ago Karma: 0
OK - I found "com_ariquiz/models/forms/quiz/quiz.xml" and have modified it to add..

<param type="text" name="QuizRrp" size="5" default="" label="COM_ARIQUIZ_LABEL_QUIZRRP" description="COM_ARIQUIZ_DESCR_QUIZRRP" />
<param type="text" name="QuizDiscount" size="5" default="" label="COM_ARIQUIZ_LABEL_QUIZDISCOUNT" description="COM_ARIQUIZ_DESCR_QUIZDISCOUNT" />

..into the ExtraParams elements.. (although this will get overwritten on an update right?) and I now have the extra elements..

Took me a little while find the XML file lol.. Is this what you were going to suggest as a quick mod?

I would still prefer to have another Tab (called Price) with just the two fields in it if there is an easy way to achieve the functionality..
Last Edit: 2013/07/11 11:40 By xmanflash.
The administrator has disabled public write access.
 
#42621
Re:Add 2 custom fields to Quiz 10 Years, 12 Months ago Karma: 748
Yes, if you don't need new parameters in separate columns in database table, the most easy way to add them to quiz.xml file.

Regards,
ARI Soft
The administrator has disabled public write access.
 
Go to topPage: 1