Can I add an additional T&C to checkout?

  • Posts: 198
  • Thank you received: 5
11 years 8 months ago #125109

-- HikaShop version -- : HikaShop Business 2.2.1
-- Joomla version -- : 3.1.5
-- PHP version -- : 5.3

I would like to know if it would be possible to add an additional Terms & Condition document that the user has to approve to the checkout.

We actually would need a different one for each product, but I cannot think of an easy way this would work. Since we are not going to have more than 3 or 4 products at any given time (and they change every few weeks) it would be feasible to add each product agreement into the same document, but it would be ideal if I could have the general T&C at checkout as normal and add another one below it. Same format but different document.

Can this be done? I see that adding an additional step is very easy, but I can't see a way where I can choose a different document for this additional step.

Thank you.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 8 months ago #125162

Hi,

What can be done is creating a custom field via the menu Display > Custom fields.
Then select the table "order" to display it in the checkout (or "item" to have it on a product page), for the type select "checkbox" and set a value for this text box.
To put a link in the text, you have to set a value like "CUSTOM_TERMS_AND_CONDITIONS" then in Configuration > Languages add an override to display the desired text, like:

CUSTOM_TERMS_AND_CONDITIONS="My terms and conditions <a href='yourcustomlink'>here</a>"

The following user(s) said Thank You: conticreative

Please Log in or Create an account to join the conversation.

  • Posts: 198
  • Thank you received: 5
11 years 8 months ago #125302

Thanks. Sound like a good solution.

Is there maybe a way to associate custom fields to specific products? Our plan is to insert in this additional document all the current products agreements, pointing out that only the one relative to the product they are purchasing is the valid one, but having the ability to have them check a box on the product page as a way to accept the product specific agreement would be even better.

Is there a way to accomplish that? If not, we'll do it the way you explained.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 8 months ago #125335

To display the custom field only for some products, you will have to edit the view "product / show_block_custom_item".
And add a if condition to display or not the specific custom field depending on the product id.
Something like:

	if($fieldName == 'myFieldName' && !in_array($this->element->product_id,array('xx','yy'))){
		// don't display the field
	}

Please Log in or Create an account to join the conversation.

  • Posts: 198
  • Thank you received: 5
11 years 8 months ago #125411

Yes, that looks like it would work. However, I am always a bit concerned in making changes to the core of Joomla or any major component. Is there an override system I can use? Otherwise I would need to repeat this procedure every time Hikashop is updated.

Please Log in or Create an account to join the conversation.

  • Posts: 26251
  • Thank you received: 4040
  • MODERATOR
11 years 8 months ago #125534

Hi,

The modification that Xavier gave you is something to put in a view override.
You can access to the HikaShop view in the backend, thanks to the menu : "Display > View".
Just edit the view "frontend | your_current_frontend_template | product | show_block_custom_item" and you will create an override for this specific view for your frontend template.

You won't modify the HikaShop core directly and you won't loose your modification by updating HikaShop.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: conticreative

Please Log in or Create an account to join the conversation.

Time to create page: 0.067 seconds
Powered by Kunena Forum