AdamPole 0 Posted January 14 Posted January 14 Hi to all, I wanted to change the default message "Last items in stock" to information about how many items are left in stock, so first I changed the message in Translations in Admin from "Last items in stock" to "Available items: ", and then in product-add-to-cart.tpl I changed this bit: {block name='product_availability'} <span id="product-availability"> {if $product.show_availability && $product.availability_message} {if $product.availability == 'available'} <i class="material-icons rtl-no-flip product-available"></i> {elseif $product.availability == 'last_remaining_items'} <i class="material-icons product-last-items"></i> {else} <i class="material-icons product-unavailable"></i> {/if} {$product.availability_message} {/if} </span> {/block} ... to this - removed <i class="material-icons product-last-items"></i>, as it did not fit, and then added {$product->quantity}: {block name='product_availability'} <span id="product-availability"> {if $product.show_availability && $product.availability_message} {if $product.availability == 'available'} <i class="material-icons rtl-no-flip product-available"></i> {elseif $product.availability == 'last_remaining_items'} {$product->quantity} {else} <i class="material-icons product-unavailable"></i> {/if} {$product.availability_message} {/if} </span> {/block} I have no idea why on the page I see "1 Available items:" instead of "Available items: 1" - the number is in front of the message, not behind. Where is the problem? How should I fix it? I would appreciate any tips. Adam Share this post Link to post Share on other sites
jetway 33 Posted January 19 Posted January 19 Because you didn't change the html output section located further down in the tpl file. Share this post Link to post Share on other sites
AdamPole 0 Posted January 19 Posted January 19 Hi jetway, This is the rest of this particular .tpl file (product-add-to-cart.tpl): {hook h='displayTtWishlistButton' product=$product} {block name='product_minimal_quantity'} <p class="product-minimal-quantity"> {if $product.minimal_quantity > 1} {l s='The minimum purchase order quantity for the product is %quantity%.' d='Shop.Theme.Checkout' sprintf=['%quantity%' => $product.minimal_quantity] } {/if} </p> {/block} I am not sure what should I change in this last bit, so the output is "Available items: 1" (not reversed to "1 Available items:"). Can you help me and suggest what to do? Share this post Link to post Share on other sites
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