Author Topic: Module: Show Discounted Products  (Read 22533 times)

juro

  • Beginner
  • *
  • Posts: 40
Module: Show Discounted Products
« on: August 03, 2009, 00:07:52 am »
I needed a module that shows all discounted products and a 'show all' button. For everyone else's convenience, here is the module. If you have questions, please contact me.

[attachment cleanup by admin]

giellacustoms

  • Beginner
  • *
  • Posts: 41
Re: Module: Show Discounted Products
« Reply #1 on: September 02, 2009, 23:02:02 pm »
I was looking for this, thanks... but I didnt see a direction sheet included.  I hope I won't need it.  THANKS AGAIN

giellacustoms

  • Beginner
  • *
  • Posts: 41
Re: Module: Show Discounted Products
« Reply #2 on: September 11, 2009, 20:04:04 pm »
I needed a module that shows all discounted products and a 'show all' button. For everyone else's convenience, here is the module. If you have questions, please contact me.

I installed this and activated it but dont know where to go from there, I didnt see a read me anywhere

Doggiefield

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 57
    • POS for Webshops
  • VirtueMart Version: 2 & 3
Re: Module: Show Discounted Products
« Reply #3 on: September 28, 2009, 08:41:22 am »
In the back-end everything seems ok. But on the website I got the following error:
Fatal error: Call to undefined method ps_product::product_snapshot_template() in /usr/home/XXXXX/domains/XXXXXX.nl/public_html/modules/mod_virtuemart_discounts/tmpl/default.php on line 24
Any idea what this could be?
Point of sale for Virtuemart
https://www.posforwebshops.com

anecdotoff

  • Beginner
  • *
  • Posts: 2
    • 01 worldwide jokes
Re: Module: Show Discounted Products
« Reply #4 on: October 09, 2009, 00:05:49 am »
Hi, there

I have made some correction on this module. So you can enjoy with this module and use them wherever you want  ;) Ask your questions vie PM

regards  

[attachment cleanup by admin]
coding is like alcohol: from the first step you can't stop :D

Lylene

  • Jr. Member
  • **
  • Posts: 118
Re: Module: Show Discounted Products
« Reply #5 on: November 02, 2009, 21:23:33 pm »
Hey !

Your module is very interesting ! In the readme, I see on point 4 that a template file is needed ...

could you please provide here one, as I can't develop one myself :)

Thanks in advance
Lylene

anecdotoff

  • Beginner
  • *
  • Posts: 2
    • 01 worldwide jokes
Re: Module: Show Discounted Products
« Reply #6 on: November 02, 2009, 22:54:23 pm »
Always ready to help. Take a look to excample of tmp.php file:
Code: [Select]
<?php if( !defined'_VALID_MOS' ) && !defined'_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); ?>


<div class="home-featured-block" style="width:271px; float:left;">
<div class="home-featured-inner" style="height:auto;">
<div class="home-featured-blockImageContainer">
                <a title="<?php echo $product_name ?>" href="<?php echo $product_link ?>" align="center">
<?php
// Print the product image or the "no image available" image
echo ps_product::image_tag$product_thumb_image"alt=\"".$product_name."\" width=\"247\"");
?>

</a>
</div>
               
<div class="home-featured-productPrice">
<?php
if( !empty($price) ) {
echo $price;
}
?>

</div>
            </div>
<div style="margin:5px 0px 10px 0px; font-weight:bold;">
<?php if( $show_product_name ) : ?>
<a title="<?php echo $product_name ?>" href="<?php echo $product_link ?>" class="browse-product-title-strindex"><?php echo $product_name ?></a>
<?php endif; ?>
</div>
            <div style="clear:both"></div>
        </div>
don't forget about directory you must to place this file and correct name of the file  ;)
coding is like alcohol: from the first step you can't stop :D

Lylene

  • Jr. Member
  • **
  • Posts: 118
Re: Module: Show Discounted Products
« Reply #7 on: November 09, 2009, 23:51:55 pm »
Hello anecdotoff !

Thanks for your answer !

I've been trying again, installing your module, modifying ps_product.php, creating a template file with your code named discountsnapshot.php in common directory : when I call your module with loadposition, I have a blank page ...

do you have any idea ?

thanks in advance
Lylene

[attachment cleanup by admin]

brianxaos

  • Beginner
  • *
  • Posts: 8
Re: Module: Show Discounted Products
« Reply #8 on: March 01, 2010, 00:58:42 am »
This module is excellent, but i'm having a problem when i try to display only sale items from a specific category. 

i get the following warning:

Warning: Invalid argument supplied for foreach() in ..../modules/mod_vm_discounted/tmpl/default.php on line 15


    <?php
      foreach ($products as $key=>$product)
      {
           echo $ps_product->product_snapshot_templates($product->product_sku, true, true, true, 'common/discountsnapshot.tpl.php');   
      }
     ?>
       
i've reinstalled and looked through the code quite a bit, but still not sure why its not working.


Fresher

  • Beginner
  • *
  • Posts: 47
Re: Module: Show Discounted Products
« Reply #9 on: March 03, 2010, 21:51:34 pm »
have somebody fixed it? thanks.

xLaM

  • Beginner
  • *
  • Posts: 10
Re: Module: Show Discounted Products
« Reply #10 on: June 08, 2010, 18:27:29 pm »
This module is excellent, but i'm having a problem when i try to display only sale items from a specific category. 

i get the following warning:

Warning: Invalid argument supplied for foreach() in ..../modules/mod_vm_discounted/tmpl/default.php on line 15


    <?php
      foreach ($products as $key=>$product)
      {
           echo $ps_product->product_snapshot_templates($product->product_sku, true, true, true, 'common/discountsnapshot.tpl.php');   
      }
     ?>
       
i've reinstalled and looked through the code quite a bit, but still not sure why its not working.


yes i have same problem, did any body can fix it?

erichartley

  • Beginner
  • *
  • Posts: 7
Re: Module: Show Discounted Products
« Reply #11 on: August 11, 2010, 20:54:27 pm »
This is discussed on the page below, but because I know very little about PHP I can't implement a solution.

http://php.net/manual/en/control-structures.foreach.php

One person writes: "A common problem is having PHP generate an error when trying to iterate through an array that may sometimes have no data in it.  This causes PHP to generate a warning such as:

Warning: Invalid argument supplied for foreach() in test.php on line 14

You can prevent this error by type-casting the foreach variable as an array type using "(array)" before the array variable name."

Does anyone know how to fix this? I tried to implement the solutions on this page and got nowhere! Thanks!


mbit

  • Jr. Member
  • **
  • Posts: 323
Re: Module: Show Discounted Products
« Reply #12 on: December 10, 2010, 17:02:23 pm »
How can i have 3 products in every row?

hex_trinity

  • Beginner
  • *
  • Posts: 2
Re: Module: Show Discounted Products
« Reply #13 on: December 24, 2010, 09:50:08 am »
I did everything according to the Readme file and the module shows the number of discounted products that I specify in settings. But when I clock "Show All" button nothing happens. It doesn't show the rest of the products/ what might be the problem?

hex_trinity

  • Beginner
  • *
  • Posts: 2
Re: Module: Show Discounted Products
« Reply #14 on: December 24, 2010, 11:12:46 am »
I just noticed that the page below loads all the discounted products. I thought that they would be loaded in the module position, but it doesn't work that way.