mcbain.neil Posted August 4, 2014 Share Posted August 4, 2014 When viewing the product, I want the available quantity to be hidden from the "usual" retail buyer (customer group), however it must be visible to a "bulkbuyer" customer group. Thanks in advance Link to comment Share on other sites More sharing options...
PascalVG Posted August 5, 2014 Share Posted August 5, 2014 Hi, you could do some little test and dependent on the current group show a message or not, like: {if $customer->id_group_default== <ID_number_of_bulkbuyer_customer_group> } <code for displaying the quantity> {/if} My 2 cents, pascal Link to comment Share on other sites More sharing options...
mcbain.neil Posted August 5, 2014 Author Share Posted August 5, 2014 Hi, you could do some little test and dependent on the current group show a message or not, like: {if $customer->id_group_default== <ID_number_of_bulkbuyer_customer_group> } <code for displaying the quantity> {/if} My 2 cents, pascal Thanks Pascal Thing is how can I pickup the variable $customer->id_group_default in the product.tpl - if I print the variable to the screen, its blank - sorry for all the questions, but im a noob Link to comment Share on other sites More sharing options...
mcbain.neil Posted August 5, 2014 Author Share Posted August 5, 2014 Ok, just got this one right , for anyone else interested I install the following module which puts the customergroup into a smarty variable (customergroup.zip from http://www.prestashop.com/forums/topic/228277-get-customer-group-id-in-smarty/) and added the code at the bottom to the product.tpl http://www.prestashop.com/forums/index.php?app=core&module=attach§ion=attach&attach_id=70595 <!-- start Show Qty if BULK BUYER --> {if is_array($customerGroups) } {if $customerGroups[0]['id_group']==4 } <p id="pQuantityAvailable"{if $product->quantity <= 0} style="display: none;"{/if}> <span id="quantityAvailable">{$product->quantity|intval}</span> <span {if $product->quantity > 1} style="display: none;"{/if} id="quantityAvailableTxt">{l s='Item in Stock'}</span> <span {if $product->quantity == 1} style="display: none;"{/if} id="quantityAvailableTxtMultiple">{l s='Items in stock'}</span> </p> {/if} {/if} <!-- end Show Qty if BULK BUYER --> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now