Jump to content

 

quicksnap

Member Since 26 Jun 2012
Offline Last Active Aug 17 2012 09:03 PM
-----

Topics I've Started

Memory exhausted with custom product view

06 August 2012 - 05:31 PM

Hello,

Thanks in advance for any help you could offer me on this issue:

In the store I'm working with, I've created a block that renders all of the stores items, which are about 100 items or so. The objective is to have a single-page listing, with options, pricing and checkout buttons.

I've successfully modified the file in customer/blocks/list_templates/product_list.tpl so that it displays options, quantity pricing, etc., but now am encountering memory issues on since migrating servers.

I realize that this operation could be memory intensive, but exhausting over 128MB seems like something else is wrong.

I've narrowed down the section that causes the memory issue to the prices area, lines 85-144: http://pastebin.com/wvXere9B -- when I remove them, I'm able to render the page just fine.

Does anyone know how I can avoid this memory issue? Is it do to the nested foreach loops in this template in conjunction with the large data set? I'm finding difficulty in debugging where exactly this leak is occurring and appreciate any guidance.

Thanks

Addon Database Initialization

27 June 2012 - 06:23 PM

I am making an addon that will perform simple CRUD per-product, associating admin-created text for each product.

Where is best place to put database initialization code for an addon? Are there any CS Cart best practices in performing this function?

Also, which template hooks would be best for providing admins with simple interface per-product? So that they may navigate to any item and see my addon's fields per-product?

Thanks for any information.

Addon: creating a new Products filling

27 June 2012 - 05:46 PM

*moved from Hints & Modifications*

Hello all,

I'm new to CS-Cart, currently using 2.24.

I'm working to create an addon that displays all products on a single page, grouped by their topmost category. I figure I can accomplish this by creating a new block filling.

I've currently created a new filling in the following manner within addons/dealer_categories/schema/block_manager/structure.post.php:


$schema['products']['fillings']['dealer_categories'] = array (
'params' => array (
'status' => 'A',
)
);

$schema['products']['appearances'][] = 'addons/dealer_categories/blocks/dealer_categories.tpl';

One question I have is how would one change the drop-down title displayed in the Block Manager? It is currently "_dealer_categories", and the Appearance is '_dealer_categories.tpl'

Since this will be on the front page, I will be going about creating an index.post.php and assigning the category tree to the view. With the products and the category tree I can construct everything needed with templates and javascript.

Does my approach seem sound? Again, I'm very new with CS Cart, so any suggestions on best practices or resources are more than welcomed.

Thanks.

Addon: creating a new Products filling

27 June 2012 - 12:02 AM

Moved to Developer's forum..