My client wanted to have the quantity field display in products grid mode so his customers could bypass the product details page. Check it out at www.thehandcrafted.net or www.thehandcrafted.com.
I modded much of the products_grid content myself. I believe I’m in version 2.0.14.
Modding those files was fairly straightforward, but the quantity selection field was still too wide for the 4-across layout.
CS Cart customer service very generously helped me out and provided a description of what they did. With their permission, here is the description:
------------------------------------------------------------------------------------------------------
We made some code changes according to your needs:
- Created the “styles.post.tpl” file in the “skins/aquarelle_green/customer/addons/my_changes/hooks/index” directory with the following content:
3) Created the "styles.css" file in the "skins/aquarelle_green/customer/addons/my_changes" directory with these tyle parameters:
/*[nastena]*/
.custom-product-list-field input {
margin-left: -10px;
}
.custom-form-field label {
font:bold 10px verdana,geneva,arial,helvetica,sans-serif;
margin-right: 15px;
}
/*[/nastena]*/
4) Save the file.
5) Replaced this part of code:
with this one:
{*[nastena]*}
{if $controller == "categories" && $mode == "view"}
{else}
{/if}
{*[/nastena]*}
in the "product_data" file located in the "skins/aquarelle_green/customer/common_templates" directory of your CS-Cart installation.
________________________________________________________________
Next, I removed
$controller == "categories" &&
from
{*[nastena]*}
{if $controller == "categories" && $mode == "view"}
{else}
{/if}
{*[/nastena]*}
In the product data field so the modification shows in other places where I'm using products grid view.
This forum has helped me a lot. I hope my post helps someone.
-----------------------------------------------------------------------------------------------------
Here are the changes I made to products_grid if anyone would like to see:
{foreach from=$splitted_products item="sproducts" name="sprod"}
{foreach from=$sproducts item="product" name="sproducts"}
{assign var="obj_id" value=$product.product_id}
{include file="common_templates/product_data.tpl" product=$product}
{assign var="obj_id_prefix" value="`$obj_prefix``$product.product_id`"} {if $product} {assign var="form_open" value="form_open_`$obj_id`"} {$smarty.capture.$form_open} {hook name="products:product_multicolumns_list"} {* kolyosick *} {include file="common_templates/image.tpl" obj_id=$obj_id images=$product.main_pair object_type="product" class="cm-thumbnails cm-single" show_detailed_link=true detailed_link_class="hidden"} {* /kolyosick *} {$product.product|unescape} {assign var="add_to_cart" value="add_to_cart_`$obj_id`"} {$smarty.capture.$add_to_cart} I also had to adjust customer>views>categories>custom_templates>products_grid.tpl as follows: {* $Id: products.tpl 8327 2009-11-27 09:11:44Z angel $ *} {** template-description:products_grid **} {include file="blocks/list_templates/products_grid.tpl" show_trunc_name=true show_sku=true show_rating=true show_old_price=true show_price=true show_description=true show_descr=true show_prod_descr=true show_product_edp=true show_add_to_cart=$show_add_to_cart|default:true show_product_options=$show_product_options|default:false show_list_buttons=true but_role="action" separate_buttons=true show_qty=true show_name=true show_features=true show_clean_price=true show_list_discount=true show_discount_label=true show_product_amount=true show_min_qty=true } Note: for some reason my "short description" field would take precedent over my description field. Not sure why. I deleted all my short descriptions to fix it. I'm out of my depth here, so much of the above code is probably pretty weak and certainly not upgrade-proof I would't think. However, for what it's worth, it works. |