Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

jQuery Cycle What's New


madbusu

Recommended Posts

i just install fresh 2.3.3 version of oscommerce ...and i wanna use this addon jQuery Cycle What's New http://addons.oscommerce.com/info/8881/v,23

 

i follow the instruction i install addons before ...but this 1 it's not working for me

the problem appears the What's New box expand down with all new products...and there is no cycle effect.

 

i double check installation procedure all seems fine at this side ...

 

any1 got this addon to work ?

Link to comment
Share on other sites

  • 2 weeks later...
  • 9 months later...

i just install fresh 2.3.3 version of oscommerce ...and i wanna use this addon jQuery Cycle What's New http://addons.oscommerce.com/info/8881/v,23

 

i follow the instruction i install addons before ...but this 1 it's not working for me

the problem appears the What's New box expand down with all new products...and there is no cycle effect.

 

i double check installation procedure all seems fine at this side ...

 

any1 got this addon to work ?

Hi,

I was the same problem, i find what is the problem. You must put this line:

<script type="text/javascript" src="ext/modules/jQueryCycle/jquery.cycle.all.custom.min.js?1100"></script>

BEFORE:

<script type="text/javascript">
$('.slideshow').cycle({});
// fix jQuery 1.8.0 and jQuery UI 1.8.22 bug with dialog buttons; http://bugs.jqueryui.com/ticket/8484
if ( $.attrFn ) { $.attrFn.text = true; }
</script>
 
I was put the first line just before the </head> and have the same problem. 
Link to comment
Share on other sites

I installed it and works fine!!

But I have 2 questions

1. How can I increase the speed of cycle between a products.

2. Is there any way to random the new products? It always start with the same order of products

 

I'm aware of that this reply is a little bit late, I didn't know of this thread. But here's the answers if someone else wonders the same things.

 

1: Best is if you check the jQuery Cycle Plugin website for options. To change the Speed (Time of Sliding Effect) & TImeout (Time between slides), simply change this:

$('.slideshow').cycle({});

To this:

$(function(){
  $('.slideshow').cycle({ speed: 800, timeout: 100 });
});

Notice the new first and third line? That was the problem in the instructions causing the slide to now show properly, adding $(function(){ [your_code] }); will make sure that the code inside the brackets will not execute until the DOM has finished loading.

jQuery Cycle Website: http://jquery.malsup.com/cycle/options.html

 

2: Yes, there is. There's many ways you can do this, here's one of them. In bm_cycle_whats_new.php find this SQL query:  

if ($random_product_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, p.products_price, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id AND p.products_status = '1' AND pd.language_id = " . (int)$languages_id . " order by p.products_date_added desc limit " . MAX_RANDOM_SELECT_NEW)) {

  Replace With:

      if ($random_product_query = tep_db_query("SELECT p.products_id, p.products_image, p.products_tax_class_id, IFNULL((SELECT specials_new_products_price FROM " . TABLE_SPECIALS . " WHERE status = 1 and products_id = p.products_id), p.products_price) as products_price, (SELECT products_name FROM " . TABLE_PRODUCTS_DESCRIPTION . " WHERE language_id = " . (int)$languages_id . " AND products_id = p.products_id) AS products_description FROM " . TABLE_PRODUCTS . " p WHERE p.products_status = '1' AND products_id > ((SELECT MAX(products_id) FROM " . TABLE_PRODUCTS . ") / 1.3) ORDER BY RAND() LIMIT " . MAX_RANDOM_SELECT_NEW)) {

This Query will select a random amount of products with product_id's over maximum products_id / 1.3. E.g. if you have 130 products, then the result would be a span of products ranging between products_id 100 to 130.

 

Note that if you have caching set to true then this will not work. To disable caching for this module, find this code from the same file:

      if ((USE_CACHE == 'true') && empty($SID)) {
        $output = tep_cache_cycle_whats_new_box(86400);
      } else {
        $output = $this->getData();
      }

Replace with:

      $output = $this->getData();

Here's the SQL Query 'Beautified':

SELECT 
    p.products_id,
    p.products_image,
    p.products_tax_class_id,
    IFNULL((SELECT 
                    specials_new_products_price
                FROM
                    specials
                WHERE
                    status = 1
                        and products_id = p.products_id),
            p.products_price) as products_price,
    (SELECT 
            products_name
        FROM
            products_description
        WHERE
            language_id = 1
                AND products_id = p.products_id) AS products_description
FROM
    products p
WHERE
    p.products_status = '1'
        AND products_id > ((SELECT 
            MAX(products_id)
        FROM
            products) / 1.3)
ORDER BY RAND()
LIMIT 9
Edited by Dr. Rolex
Link to comment
Share on other sites

  • 6 months later...

G'Day,

 

the result of this contrib is pretty nice, but when I reduce the size of the website the what's new box doesn't reduce its size. So the text (the name of the products) leaves the box border than so it doesn't look nice at all then.

Any suggestions how to fix it?

 

Thanks in advance.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...