Jump to content

Show Available Quantity Depending on Customer Group


mcbain.neil

Recommended Posts

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

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

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&section=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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...