| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Available stock to featured admin | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() I want to be able to see if the product has stock available in the part I view in admin/categories.php where you add the featured items.
I am in the /skin/myskin/common/admin/featured_products.tpl I have added a new colm in the part I want but when I try to use the smarty code for the query it wants to be a Y instead of the number available. The Y/N has been subsituted for the available stock count VAR so now it is featured product = active true false, so will I need to do another query just for the avaiblity of stock itself ? Is there another var / query / php I need to add for the available amount to show on the admin featured_products.tpl ? How I think the var query is : table [field_productid]. field_valueneeded v4.4.3 I have tried a few none work Code:
Code:
But this does not work I have tried others to Code:
Code:
__________________
x-cart 4.4.3 |
|||||||
#2
|
|||||||||
|
|||||||||
![]() You should alter the PHP script first (admin/categories.php) and add the required data selection, e.g. like this:
Code:
After that you can use something like {$products[productid].in_stock} in the template. Note: the example SQL wont work for products with variants due to the fact that variants stock is stored in another table. more complex SQL will be required. You can find more info about X-Cart DB structure here.
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful ![]() Click here to learn how to apply patches X-Cart Extensions |
|||||||||
#3
|
|||||||
|
|||||||
![]() Thank you for the help this will help me understand how xcart works more now.
If I add the code As in_stock to the query the featured products goes blank as if there are none set. If I take it away from the query, I get the amount of products avaiable but the Featured Active is removed so no checked boxs to the active featured products. Works to a limit with {$products[prod_num].avail} , no active check boxes its conflicting with this {$products[prod_num].productid}][avail]"{if $products[prod_num].avail eq "Y"} So now its the other way around i get what i want but the active is now not a Y or N Code:
__________________
x-cart 4.4.3 |
|||||||
#4
|
|||||||
|
|||||||
![]() Ok got there in the end thanks for your help pointing me in the right direction.
![]() Now no need to look on the front page to see if its been added to the featured produsts or if its out of stock, as I do not show out of stock Items I do not know what has gone missing from the front. Also the select featured product should have this because I am forever trying to find in stock items by name in the select featured products lists. I think next I will either make a mod for just adding products to the featured products by productid or sku would be a much easier way, no searching massive lists then finding out its not in stock. Query Code:
Smarty Tag Code:
__________________
x-cart 4.4.3 |
|||||||
|
|||
X-Cart forums © 2001-2020
|