Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Need Help on customizing the "New Products for May" Module!

Need Help on customizing the "New Products for May" Module!

Views: 2,991

Results 21 to 36 of 36
10 May 2011, 4:13 AM
#21
wmorris avatar

wmorris

Totally Zenned

Join Date:
Aug 2007
Location:
Amarillo, Tx
Posts:
1,682
Plugin Contributions:
0

Need Help on customizing the "New Products for May" Module!

Linda,,, I have it working now.

13 Sep 2011, 9:12 PM
#22
mikeislearning avatar

mikeislearning

New Zenner

Join Date:
Sep 2011
Posts:
23
Plugin Contributions:
0

Re: Need Help on customizing the "New Products for May" Module!

Thanks Guys. Thanks Ajeh. That code works well. I know this post is old... but any idea how to add the link to the manufacturer??? I used your code:

$manufacturers_name= zen_get_products_manufacturers_name($new_products->fields['products_id']);

$list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . $manufacturers_name . '<br />' . '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a><br />' . $products_price);
13 Sep 2011, 11:32 PM
#23
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need Help on customizing the "New Products for May" Module!

Did you try to look at how the link is made for the Manufacturer's Info sidebox in the:
tpl_manufacturer_info.php

14 Sep 2011, 7:18 AM
#24
mikeislearning avatar

mikeislearning

New Zenner

Join Date:
Sep 2011
Posts:
23
Plugin Contributions:
0

Re: Need Help on customizing the "New Products for May" Module!

There are no href files in the sideboxes, and I'm really rusty with my html but I think I found something in the modules/product_listing.php

$lc_text = '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a>';

not sure where to put it... or if the $lc_text is defined in the new_products.php page, or how to define it or what this line means.. but I think it is does hyperlink the manufacturer name.. any input? Thank you for any help.

I'm gonna keep messing around and maybe by trial and error I'll stumble upon something. Will let you and the zencart world know if I figure this one out.

14 Sep 2011, 9:58 AM
#25
mikeislearning avatar

mikeislearning

New Zenner

Join Date:
Sep 2011
Posts:
23
Plugin Contributions:
0

Re: Need Help on customizing the "New Products for May" Module!

Been working on this for a few hours now.. with no success. But I am starting to decipher what all this code means. So now my question is:

Do you know the cPath to a manufacturer by the manufacturers_id??

For instance: The following code causes the product_name to link to the corresponding product_id page.

CODE:
<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a><br />' . $products_price);

GOES TO SOMETHING LIKE http://site.com/index.php?mainpage=product_id=1

So now.. I'm trying to manipulate that code to go to the page based on the manufacturer id (instead of product_id).

WANT TO GO TO SOMETHING LIKE : http://site.com/index.php?index&manufacturers_id=1

The closest I can come up with is:
<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $manufacturers_name . '</a>

it shows the manufacturer and is linked, but the link goes to some blank page. I'm wondering if I need the cPath and what that cPath might look like?

Do I need the something like <a href="' . zen_href_link(zen_get_info_page($somethinghere[?]), cPath = A bunch of stuff here?? >' . $manufacturers_name . '</a>

??

Any and all help makes you my savior... thanks

14 Sep 2011, 1:52 PM
#26
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need Help on customizing the "New Products for May" Module!

This needs to be changed:
$listing->fields['manufacturers_id']

it is either going to be the:
$_GET['manufacturers_id']

or when the Catagory is selected it is the:
$_GET['filter_id']

15 Sep 2011, 7:18 AM
#27
mikeislearning avatar

mikeislearning

New Zenner

Join Date:
Sep 2011
Posts:
23
Plugin Contributions:
0

Re: Need Help on customizing the "New Products for May" Module!

So something like:

<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $_GET['manufacturers_id']) . '">' . $manufacturers_name . '</a>

or

<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $_GET['filter_id']) . '">' . $manufacturers_name . '</a>

but it still no worky :((((( ><

but my page shows up like:

http://www.mypage.com/index.php?main_page=index&manufacturers_id=

what's going on with it? why won't the manufacturers_id= a number?

feel so close, yet so far :(

if you want to look at my site its http://www.5dollarcd.com

The section of my new_products.php looks in total like:

$manufacturers_name= zen_get_products_manufacturers_name($new_products->fields['products_id']);

   
    $list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
    'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $_GET['filter_id']) . '">' . $manufacturers_name . '</a><br />' . '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a><br />' . $products_price);
15 Sep 2011, 1:54 PM
#28
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need Help on customizing the "New Products for May" Module!

For the new_products.php centerbox you need to use:

'<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . zen_products_lookup($new_products->fields['products_id'], 'manufacturers_id')) . '">' . $manufacturers_name . '</a><br />'
16 Sep 2011, 1:45 AM
#29
mikeislearning avatar

mikeislearning

New Zenner

Join Date:
Sep 2011
Posts:
23
Plugin Contributions:
0

Re: Need Help on customizing the "New Products for May" Module!

WOOT! Totally worked! THANKS A MILLION! So for anyone that wants to do the same thing (add a linkable manufacturer to the new_products page) do this:

open includes/modules/new_products.php

towards the bottom add the $manufacturers_name... line and change the $list_box_contents[$ro....... line to the following:

$manufacturers_name= zen_get_products_manufacturers_name($new_products->fields['products_id']);
   
    $list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
    'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . zen_products_lookup($new_products->fields['products_id'], 'manufacturers_id')) . '">' . $manufacturers_name . '</a><br />' . '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a><br />' . $products_price);

Thanks to Ajeh.

16 Sep 2011, 1:56 AM
#30
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need Help on customizing the "New Products for May" Module!

You are most welcome ... :smile:

7 Oct 2011, 10:01 PM
#31
mikeislearning avatar

mikeislearning

New Zenner

Join Date:
Sep 2011
Posts:
23
Plugin Contributions:
0

Re: Need Help on customizing the "New Products for May" Module!

I have a related question now:

Is there any way to use the new products centerbox on it's own page?

The look of my new products/all products/featured products is only good on the index as the center boxes. (I don't like the dropdown, sort order the products are in, and the overall layout of mainpage=products_new).

I'm sure someone has done this, I'm dying to know how.

Thanks in advance.

20 Oct 2011, 4:57 PM
#33
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Need Help on customizing the "New Products for May" Module!

Ajeh:

You are most welcome ... :smile:
Linda I have a question for you, you may or may not want to answer here. If I added a Manufactured to a product, how would I add that Manufactured to all my products without having to do them one at a time. What code could I use. Thank You very much in advance. You could move this to another thread if you would like.

20 Oct 2011, 5:08 PM
#34
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need Help on customizing the "New Products for May" Module!

If you want ALL Products to have the same Manufacturer, then check what that manufacturers_id is and you can run the SQL in phpMyAdmin for:

UPDATE products SET manufacturers_id = 'xx';

where xx is the manufacturers_id you want for ALL Products ...

20 Oct 2011, 5:23 PM
#35
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Need Help on customizing the "New Products for May" Module!

Ajeh:

If you want ALL Products to have the same Manufacturer, then check what that manufacturers_id is and you can run the SQL in phpMyAdmin for:

UPDATE products SET manufacturers_id = 'xx';

Thank You that work perfect.
20 Oct 2011, 5:24 PM
#36
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need Help on customizing the "New Products for May" Module!

You are most welcome ... thanks for the update that this worked for you ... :smile: