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.
Views: 2,991
Totally Zenned
Linda,,, I have it working now.
New Zenner
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);
Oba-san
Did you try to look at how the link is made for the Manufacturer's Info sidebox in the:
tpl_manufacturer_info.php
New Zenner
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.
New Zenner
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
Oba-san
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']
New Zenner
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);
Oba-san
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 />'
New Zenner
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.
Oba-san
You are most welcome ... :smile:
New Zenner
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.
New Zenner
Nevermind I think I found what I want here:
http://www.zen-cart.com/forum/showthread.php?t=84174&highlight=single+listing
Yellow figured it out.:clap:
Totally Zenned
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.
Oba-san
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 ...
Totally Zenned
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.
Oba-san
You are most welcome ... thanks for the update that this worked for you ... :smile:
Tell staff why this post should be reviewed.