Jump to content

enable domain addon by default ?


rob2

Recommended Posts

Hi,

 

i use the order form "standard cart" and i hope some addon(s) are added by default,

 

and client can disable it if he do not need it when ordering.

 

 

for instance,i want to set id protect as enabled by default,

 

i modify the file templates/orderforms/standard_cart/configuredomains.tpl

 

i add checked after <input type="checkbox" name="idprotection[{$num}]" ,

 

when ordering,the id protect option will show as checked by default,

 

but when i click the lower part button "add to cart" "added to cart(remove)",

 

the buttons are no works at all,

 

i think it is because the file templates/orderforms/standard_cart/base.js ,

 

do you know how can i correct the code at the base.js ?

 

 

thank you

Link to comment
Share on other sites

another way would be to remove the panel showing the add to cart message - then the user can just use the checkbox to enable/disable the addon when ordering...

 

                                        <div class="panel-add">
                                           <i class="fa fa-plus"></i>
                                           {$LANG.orderForm.addToCart}
                                       </div>

Edited by brian!
Link to comment
Share on other sites

thank for your codes,but with my testing, it seems do not work but the same result.

lol - it worked for me originally... then I came back and tested again and it failed... but at least I know why it works sometimes and not others. :)

 

in the meantime, the suggestion of removing that lower panel is a solution (as either clicking the checkbox or link in the panel adds it to the cart) - though an inelegant one! :roll:

Edited by brian!
Link to comment
Share on other sites

that'll be a css issue the line below...

 

<div class="panel panel-default panel-addon{if $domain.idprotectionselected} panel-addon-selected{/if}">

because you're enabling the checkbox automatically, $domain.idprotectionselected isn't initially true - if it was true (e.g you view cart and then return to the configuredomains page), then my previously posted code would work fine. :roll:

 

untested, but try the following and it should always be green...

 

<div class="panel panel-default panel-addon panel-addon-selected">

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated