Hello,
I just want to say thank you for this wonderful add on and forum. After only one dummy attack (it usually takes a few) it’s installed and works beautifully! Just what I’ve needed for a long time.
Thanks so much!
Renee`
Printable View
Hello,
I just want to say thank you for this wonderful add on and forum. After only one dummy attack (it usually takes a few) it’s installed and works beautifully! Just what I’ve needed for a long time.
Thanks so much!
Renee`
In Admin it says that the truncating of the description is done in the css.
I've tried to locate where that is done and cannot seem to find it.
Does anyone know which lines in which css file control this.
Thanks
So I'm trying to get my medium images to show up in the price list. My mediums are stored in images/medium/*category*. Medium images also have "_MED" after the image name.
For example: thumbnail = /images/category/image.jpg
medium = /images/medium/category/image_MED.jpg
I managed to get the image directory changed to images/medium by changing line 646 of header_php.php to:
The code i added is in red.Code:$prodRow .= zen_image(DIR_WS_IMAGES . 'medium/' . $cats[$cat_index][$prod_index]['products_image'], '', PL_IMAGE_PRODUCT_WIDTH, PL_IMAGE_PRODUCT_HEIGHT, 'class="imgPL"');
However now I'm stuck. I'm not sure how to append _MED to the end of 'products_image'. Something is going on with an array there, and i couldnt find its origin. can you tell im no php expert?
If anyone can point me in the right direction, that'd be awesome.
From the top of my head I think "DIR_WS_IMAGES . 'medium/' . $cats[$cat_index][$prod_index]['products_image']" outputs the full path to the image including the filename and extension. To change filenames like "image.jpg" to "image_MED.jpg" you could use the PHP pathinfo() function to separate the (path and) filename and it's extension and then concatenate (glue) it all together again with the _MED in between. On the other hand there might be a Zen Cart function that gets the _MED image for you automatically, if that's the case I guess that would be a smarter approach to handle this.
Awesome tip! i got it to work with pathinfo(). I'll post my code below.
This is pretty much my first time coding in php, so if someone can improve this, please do!
I couldn't get the extension function of pathinfo() to work, but since all of my images are .jpg, its not really an issue. When i tried to concatenate the variable i had set up for extensions, it removed "medium/" from my $dir. Im not sure why...
Code:if(PL_SHOW_IMAGE == 'true'){
//parse out path
$pathparts = pathinfo((DIR_WS_IMAGES . 'medium/' . $cats[$cat_index][$prod_index]['products_image']));
//to vars
$dir = $pathparts['dirname'];
$file = $pathparts['filename'];
//go go power rangers
$prodRow .= zen_image($dir . '/' . $file . '_MED' . '.jpg', '', PL_IMAGE_PRODUCT_WIDTH, PL_IMAGE_PRODUCT_HEIGHT, 'class="imgPL"');
}
One more question, if anyone feels like answering:
I'm trying to get the products_url row from the products_descriptions table to show up in the "manufacturer" box (because the manufacturer field doesnt matter to me in this case)
I think i need to edit this section:
And possiblyPHP Code:
// get manufacturer_name
$manufacturers_name = array();
if (PL_SHOW_MANUFACTURER == 'true')
{
$sql = "SELECT m.manufacturers_id, m.manufacturers_name FROM " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS . " p WHERE m.manufacturers_id = p.manufacturers_id";
//$result = mysql_query($sql, $db->link) or die(mysql_error());
$result = $db->Execute($sql);
/*
while ($row = mysql_fetch_array($result)) {
$manufacturers_name[$row['manufacturers_id']] = $row['manufacturers_name'];
}
mysql_free_result($result);
*/
while (!$result->EOF) {
$manufacturers_name[$result->fields['manufacturers_id']] = $result->fields['manufacturers_name'];
$result->MoveNext();
}
But im not sure how to go about it. Can anyone point me in the right direction?PHP Code:
if (PL_SHOW_MANUFACTURER == 'true') {
$prodRow .= '<td class="manPL"><div>' . $manufacturers_name[$cats[$cat_index][$prod_index]['manufacturers_id']] . ' </div></td>' . "\n";
}
I would leave the first section alone, and try the following hack on the second:
And document the changes...Quote:
if (PL_SHOW_MANUFACTURER == 'true') {
$prodRow .= '<td class="manPL"><div>' . '<a href="' . zen_href_link(zen_get_info_page($cats[$cat_index][$prod_index]['products_id']), 'products_id=' . $cats[$cat_index][$prod_index]['products_id']) . '"> ' . MORE_INFO_TEXT . '</a>' . ' </div></td>' . "\n";
}
Thanks for the input again! Im actually looking to display the products_url database field from the database products_description, which actually doesn't contain the URL. We use it to hold our bin numbers for picking certain items in the warehouse.
I couldn't figure out how to get the code to grab a different database field.
Does anyone have this up and running on v1.5.3? I've installed everything but am getting this error:
In trying to fix it I'm finding that the command is a depreciated value but I'm not sure how to update it. Everything I've tried has failed. Any ideas? Thank you.Quote:
PHP Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /hsphere/local/.../includes/modules/pages/pricelist/header_php.php on line 185