First off I want to give credit for the inspiration of this design to Indigo Aquatic. I really like the design of their site. While this design might be similar I feel there are plenty of differences between them and hope they aren’t upset.
I am working on changing my product list pages to a different design and need some help. I have been able to create a hook file for the hook:
products:product_block
This is how my design looks right now:
This is how I want it to look:
As you can see, all I want to do is add the add to cart button.
I have messed around with the code and I just can’t figure it out. Does anyone have any ideas?
Brandon
[quote name=‘brandonvd’]
products:product_block
This is how my design looks right now:
This is how I want it to look:
As you can see, all I want to do is add the add to cart button.
I have messed around with the code and I just can’t figure it out. Does anyone have any ideas?
Brandon[/quote]
Have you had any luck finding the answer?
Well kind of. I was able to get the add to cart to work, but I couldn’t get it to look like a button. I also realized that since some of my products have options, I would need to have the options listed so that the customer could choose them before adding the item to the cart. This was ok for products that only had one option, but when there were more options it made it so that the look of my list wasn’t what I wanted.
For now I think I might leave the add to cart button off of my products list and make it so a product can only be added in the product details page.
If I can figure something better out than that might change.
If you are curious though. This code below will add the add to cart link. Like I said, I couldn’t get a button, but I didn’t play with it much.
```php
{if !$hide_form}
{if !$stay_in_cart}
{/if}
{/if}
{if $hide_add_to_cart_button != "Y"}
{if !$simple && $product.product_options}
{include file="views/products/components/product_options.tpl" id=$obj_id product_options=$product.product_options name="product_data"}
{/if}
{if ($product.qty_content || $show_qty) && $product.is_edp !== "Y" && $cart_button_exists == true}
{$lang.quantity}:
{if $product.qty_content}
{foreach from=$product.qty_content item="var"}
{$var}
{/foreach}
{else}
{/if}
{if $product.prices}
{include file="views/products/components/products_qty_discounts.tpl"}
{/if}
{elseif !$bulk_add}
{/if}
{if $product.min_qty}
{$lang.text_cart_min_qty|replace:"[product]":$product.product|replace:"[quantity]":$product.min_qty}
{/if}
{if $separate_add_button}
{$smarty.capture.add_to_cart}
{/if}
{if $capture_buttons}
{capture name="cart_buttons"}
{/if}
{hook name="products:buttons_block"}
{if !$separate_add_button}
{$smarty.capture.add_to_cart}
{/if}
{hook name="products:buy_now"}
{if $product.feature_comparison == "Y"}
{include file="buttons/add_to_compare_list.tpl" product_id=$product.product_id}
{/if}
{/hook}
{/hook}
{if $capture_buttons}
{/capture}
{/if}
{/if}
{if !$hide_form}
{/if} ```
I hope this helps you,
Brandon
Brandon,
Thank you.
I have a friend that has his entire website outside of his shopping cart and all his products are on his static website with “add to cart” links to the cart.
This way he can use Dreamweaver to make complex pages easily.
I have long considered doing this…