Zen Cart Logo
Forums / All Other Contributions/Addons / Printable Price list :: support thread

Printable Price list :: support thread

Views: 232,005

Results 561 to 580 of 739
26 Sep 2014, 20:22
#561
popularcrustacean avatar

popularcrustacean

New Zenner

Join Date:
Dec 2013
Posts:
17
Plugin Contributions:
0

Printable Price list :: support thread

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:

$prodRow .= zen_image(DIR_WS_IMAGES . 'medium/' . $cats[$cat_index][$prod_index]['products_image'], '', PL_IMAGE_PRODUCT_WIDTH, PL_IMAGE_PRODUCT_HEIGHT, 'class="imgPL"');

The code i added is in red.

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.

28 Sep 2014, 10:56
#562
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Printable Price list :: support thread

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.

28 Sep 2014, 11:11
#563
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Printable Price list :: support thread

goldenstone:

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`Bit of an old post, I know, but good to see this add on is still being used and appreciated! :smile:
(although I can't look at the code now without heavy blushing...)

29 Sep 2014, 13:44
#564
popularcrustacean avatar

popularcrustacean

New Zenner

Join Date:
Dec 2013
Posts:
17
Plugin Contributions:
0

Re: Printable Price list :: support thread

paulm:

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...

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"');
      }
29 Sep 2014, 16:18
#565
popularcrustacean avatar

popularcrustacean

New Zenner

Join Date:
Dec 2013
Posts:
17
Plugin Contributions:
0

Re: Printable Price list :: support thread

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:

// 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(); 
  }

And possibly

if (PL_SHOW_MANUFACTURER == 'true') {
        $prodRow .= '<td class="manPL"><div>' . $manufacturers_name[$cats[$cat_index][$prod_index]['manufacturers_id']] . ' </div></td>' . "\n";
    }

But im not sure how to go about it. Can anyone point me in the right direction?

29 Sep 2014, 21:51
#566
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Printable Price list :: support thread

I would leave the first section alone, and try the following hack on the second:

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";
}And document the changes...

30 Sep 2014, 12:38
#567
popularcrustacean avatar

popularcrustacean

New Zenner

Join Date:
Dec 2013
Posts:
17
Plugin Contributions:
0

Re: Printable Price list :: support thread

paulm:

I would leave the first section alone, and try the following hack on the second:
And document the changes...

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.

01 Oct 2014, 10:04
#568
joyjoy avatar

joyjoy

Totally Zenned

Join Date:
Sep 2010
Posts:
611
Plugin Contributions:
0

Re: Printable Price list :: support thread

Does anyone have this up and running on v1.5.3? I've installed everything but am getting this error:

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

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.

04 Oct 2014, 20:45
#569
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Printable Price list :: support thread

PopularCrustacean:

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.I that case I misunderstood. You could maybe take a look at the products description code and copy that to the sections you suggested? I would need to look closer into it to say something more specific about this.

04 Oct 2014, 20:46
#570
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Printable Price list :: support thread

@joyjoy: Did you try to change mysql_ to mysqli_? And did that change the error message?

07 Oct 2014, 13:29
#571
popularcrustacean avatar

popularcrustacean

New Zenner

Join Date:
Dec 2013
Posts:
17
Plugin Contributions:
0

Re: Printable Price list :: support thread

paulm:

I that case I misunderstood. You could maybe take a look at the products description code and copy that to the sections you suggested? I would need to look closer into it to say something more specific about this.

I'll try to figure something out!

I've been having issues with this add on though. It'll work for a day or two, but after a change the categories a few times, it stops functioning. When i go to the pricelist page, nothing loads.

To fix it i just run the remove sql queries, then run the install queries again, but its a pain (and it clears all my settings).

Anyone else have this issue?

01 Nov 2014, 14:32
#572
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Printable Price list :: support thread

I've updated this module to v2.0.0, allowing it to operate with Zen Cart v1.5.1+ and later versions of PHP (it'll probably work on v1.5.0, but I haven't tested/validated that). The plugin can be downloaded from the Plugins area: http://www.zen-cart.com/downloads.php?do=file&id=173.

The installation SQL is now an admin-level auto-install script. Many of the plugin's profile settings have been removed, since the plugin now relies on CSS/browser interaction to provide the proper pagination. The innards of the script were re-factored to reduce the possibility of out-of-memory conditions arising on larger stores -- the data for the display is gathered, but the screen output is performed one category/product at a time to lessen the amount of memory required.

02 Nov 2014, 15:34
#573
choppa avatar

choppa

New Zenner

Join Date:
Nov 2014
Location:
Home
Posts:
1
Plugin Contributions:
0

Re: Printable Price list :: support thread

Just installed this module and I love it. Thank You! But I have some questions

  1. How to change the Sort By: Field feature

basically Sort By: Field have 3 options :
products_name
products_price
products_model

What if I wanna make it sort by products sort order and name ?

Example :
(current sort order for product_name field)

Product name Sort Order
Cloud 0
Fire 0
Stone 3
Water 2
Wind 1

(I want the sort order for product_name field to be like this)

Product name Sort Order
Cloud 0
Fire 0
Wind 1
Water 2
Stone 3
  1. How to remove the currency symbol besides the table title ?

  2. I have more than 9000 products and when I try to click the print this page link, it always make my browser error. But if I try to print like only 100 products, it works.

  3. It takes time to load All Categories and since I have some categories with thousands products in it, can I divided it to be several pages ? Like 200 products per page with previous page and next page link ?

thanks

02 Nov 2014, 16:06
#574
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Printable Price list :: support thread

@choppa

  1. I'll add the product sort_order to the list of, er, sort orders in the next release.
  2. I'll add a configuration "switch" to allow you to control whether/not the currency symbol displays.
  3. What is in the myDEBUG*.log file when you get the "browser error"? I'm thinking to add configuration values so that you can control (a) the script's timeout value and (b) the script's maximum memory required.
  4. I'll need to think about, since I think that what you're asking is a major change. Any additional details you provide regarding how you'd like it to work would be appreciated.
30 Mar 2015, 08:30
#575
thannaree avatar

thannaree

Zen Follower

Join Date:
Dec 2010
Location:
Thailand
Posts:
304
Plugin Contributions:
1

Re: Printable Price list :: support thread

Hi lat9, BIG thanks for this plugin! I think that's exactly what I need.

A question: I've set images on true and a strange thing occurs with their positions. I've just listed 4 products. On the list 2 display on he left and 2 on the right ... I refresh and 3 on the right and 1 on the left ... and every time I refresh the display change. Check this out here.

Any idea why the positions each time are different?

Note that there's a typo on profile-1.css (it now reads proile-1.css)

30 Mar 2015, 16:17
#576
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Printable Price list :: support thread

Thannaree, I don't know what's up with the "image swap"; I'll look into it shortly.

30 Mar 2015, 18:01
#577
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Printable Price list :: support thread

Thannaree:

Hi lat9, BIG thanks for this plugin! I think that's exactly what I need.

A question: I've set images on true and a strange thing occurs with their positions. I've just listed 4 products. On the list 2 display on he left and 2 on the right ... I refresh and 3 on the right and 1 on the left ... and every time I refresh the display change. Check this out here.

Any idea why the positions each time are different?

Note that there's a typo on profile-1.css (it now reads proile-1.css)
Having looked at the code, the position change is a "feature" of the plugin, mixing it up so that the images are in a random position (not so cut-and-dried of a display).

You can force the display to be the same for all cases by setting the classes .imgDescrRndPL_1, .imgDescrRndPL_2, .imgDescrRndPL_3 and .imgDescrRndPL_4 to all have the same styling.

I've opened a bug-report regarding the CSS filename on the plugin's github repository; it'll be corrected in the next release.

31 Mar 2015, 03:07
#578
thannaree avatar

thannaree

Zen Follower

Join Date:
Dec 2010
Location:
Thailand
Posts:
304
Plugin Contributions:
1

Re: Printable Price list :: support thread

Thanks for looking into it. Setting the classes on the same side fixed it.

.imgDescrRndPL_3 img, .imgDescrRndPL_4 img { float: left; }
.imgDescrRndPL_1 img, .imgDescrRndPL_2 img { float: left; }

Thanks again.

31 Mar 2015, 12:48
#579
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Printable Price list :: support thread

Thannaree:

Thanks for looking into it. Setting the classes on the same side fixed it.

Thanks again.
Most excellent! I'm glad that it's now working the way you want.

09 Apr 2015, 20:59
#580
diptimoy avatar

diptimoy

Zen Follower

Join Date:
Apr 2012
Location:
Bardhaman , Bharat
Posts:
214
Plugin Contributions:
1

Re: Printable Price list :: support thread

[09-Apr-2015 20:51:45 UTC] PHP Warning: require(includes/templates/template_default/templates/tpl_pricelist_default.php): failed to open stream: No such file or directory in E:\xampp\htdocs\zencart\kwmagic\includes\templates\evoluzion\common\tpl_main_page.php on line 117

[09-Apr-2015 20:51:45 UTC] PHP Fatal error: require(): Failed opening required 'includes/templates/template_default/templates/tpl_pricelist_default.php' (include_path='.;E:\xampp\php\PEAR') in E:\xampp\htdocs\zencart\kwmagic\includes\templates\evoluzion\common\tpl_main_page.php on line 117

after install I am getting this
I found no tpl_pricelist_default.php

Please help.Thanks in advance