Posts by PixelStores

370 posts
  • Has referred 50+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+5 more
PixelStores says

This is what OriginalEXE meant:
<div id="owl-example" class="owl-carousel" data-autoscroll="<?php echo $autoscroll; ?>" data-swipe="<?php echo $swipe; ?>">
...
</div>

And then you read the attributes with jQury like so:

var autoscroll = $("#owl-example").attr("data-autoscroll");
var swipe= $("#owl-example").attr("data-swipe");
...

Of course you can loop through all the .owl-carousel elements and apply the settings to each individual carousel.

$(".owl-carousel").each(function() {
    var carousel = $(this);
    var autoscroll = carousel.attr("data-autoscroll");
    //etc...
});
Cheers

Excellent! Thankyou for explaining so well, i understand :)

I had a hiccup on the way which using the owl-carousel class caused problems, but apart from that using data-attributes is the king don!

Cheers

370 posts
  • Has referred 50+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+5 more
PixelStores says

Hi guys,

Thankyou for your feedback, i’m kinda confused on what exactly to do regarding printing the parameters as data attributes then read them with jQuery, perhaps taking a look at the shortcode function.

function recent_products_slider_func($atts) {
    global $woocommerce_loop;
    static $count = 0;
    if (empty($atts)) return;

    extract(shortcode_atts(array(
        'title'            => 'Recent Products',
        'order'         => 'DESC',
        'orderby'         => 'date',
        'mousewheel'     => 'false',
        'autoscroll'     => '1',
        'swipe'         => 'false',
        'scroll'         => '1',
        'items'         => 6
    ), $atts));

    $args = array(
        'post_type'    => 'product',
        'post_status' => 'publish',
        'posts_per_page' => $items,
        'ignore_sticky_posts'    => 1,
        'orderby' => $orderby,
        'order' => $order,
        'meta_query' => array(
            array(
                'key'         => '_visibility',
                'value'     => array('catalog', 'visible'),
                'compare'     => 'IN'
            )
        )
    );
    wp_enqueue_script('owlcarouselcustom', get_template_directory_uri() . '/includes/pixelstores/shortcodes/js/' . 'owlcarousel.js');
    wp_localize_script('owlcarouselcustom', 'carouselvars', array(
      'autoscroll' => $autoscroll
      )
    );

    ob_start();

    $products = new WP_Query( $args );

    if ( $products->have_posts() ) : ?>

        <div class="row ps-carousel">
            <div class="col-xs-10">        
                <h3><?php echo $title; ?></h3>
            </div>
            <div class="col-xs-2">
                <div class="ps-carousel-btns">        
                    <a class="btn prev"><i class="fa fa-angle-left" /></a>
                    <a class="btn next"><i class="fa fa-angle-right" /></a>
                </div>    
            </div>    
        </div>

        <div class="row">
            <div id="owl-example" class="owl-carousel">
                <?php while ( $products->have_posts() ) : $products->the_post(); ?>
                    <?php if ( class_exists('woocommerce') ) {  woocommerce_get_template_part( 'content', 'product' ); } ?>
                <?php endwhile; ?>
            </div>
        </div>

    <?php endif; 

    wp_reset_query();       
    $count++;                  

    return ob_get_clean();
}                  
add_shortcode('recent_products_slider', 'recent_products_slider_func');   

Would be awesome to be able to provide a tutorial on the method you think works best, previously i was using iQuery within the shortcode itself.

Cheers

370 posts
  • Has referred 50+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+5 more
PixelStores says

Hi,

So i want my user to be able to use the same shortcode multiple of times on the same page with different settings, to allow this my wp_localize_script must pass a unique id ‘handle’ to the javascript, this is what i got,

/* <![CDATA[ */
var carouselvars0 = {"autoscroll":"0","caorouseldiv":"#0-owl-example"};
var carouselvars1 = {"autoscroll":"1","caorouseldiv":"#1-owl-example"};
/* ]]> */

In my JS file,

jQuery(document).ready(function($) {
    var settingObj = carouselvars1;
    var owldiv = $(settingObj.caorouseldiv);

    if(settingObj.autoscroll == 1) {settingObj.autoscroll = true;} else {settingObj.autoscroll = false;}

    $(settingObj.caorouseldiv).owlCarousel({
        autoPlay: settingObj.autoscroll,
    });

    $(".next").click(function(){
        owldiv.trigger('owl.next');
    })
    $(".prev").click(function(){
        owldiv.trigger('owl.prev');
    })
});

I’m not sure how i can call the settingObj variable to represent the handle set in the wp_localize_script?

Hope i make sense, help very much appreciated :)

Cheers

370 posts
  • Has referred 50+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+5 more
PixelStores says

When I woke up this morning, I got 0 sales and 2 sales reversal…

What sound does this make? ...lol…

370 posts
  • Has referred 50+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+5 more
PixelStores says

Slightly off topic, but i preferred the old header with the marketplaces as a dropdown.

370 posts
  • Has referred 50+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+5 more
PixelStores says

I like the concept you got going for the header with all the marketplaces logos side by side, my first impression thought, if i hovered over them i would get some fancy transitions that would display the appropriate market categories, but i have to make a click.

The overall header design doesn’t look that great, its too thin and compact for my liking.

Cheers

370 posts
  • Has referred 50+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+5 more
PixelStores says

Oops, I’m really sorry… I’m sure you will have a better next week :)

But being an unlucky guy doesn’t make you eligible for a new Envato badge. Your bad luck should be related to ThemeForest or other marketplaces to get this badge. No one can take this badge from me. It’s mine! :D

Cheers

Lol, I will have to make my own ‘Unlucky Guy Badge’. Things are already looking up, bought a 6 pack of Carling and some chocolate double deckers. ahh the small things in life.

May you have the best of luck and success :)

Best Regards

370 posts
  • Has referred 50+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+5 more
PixelStores says

I’m sorry ‘imangm’ but this badge will look nicer on me and would have it for two weeks running lol,

Where to start? Originally was looking to book a return flight to the UK, left it a day late and had to pay an extra $200. :(

A week ago before my flight, ended up in surgery for a sudden reoccurrence of Pilondinal Sinus (really hope no one gets this) that left me unable to do alot including work.

Had to catch a plane from New Zealand to the UK a couple days ago, very harsh flight for passengers over 6 foot and extremely uncomfortable with sinus injury.

Got to the UK after 2 days flying to find out they lost my luggage. All the clothes in the backpack is all i own so now a tramp with no clothes.

I’m being curst to go back to the UK… bad luck all over.

Lets hope next week is better :)

370 posts
  • Has referred 50+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+5 more
PixelStores says

I agree in principal that ratings should reflect the items that are currently for sale, but also that we wouldn’t want to encourage manipulative behaviour. A good start will be reviewing the code we have, and what it actually does :) Thanks for the input.

Yes please!

370 posts
  • Has referred 50+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+5 more
PixelStores says

I believe its allowed as long as you don’t remove the two filters, wpautop and wptexturize, like the code below.

remove_filter('the_content', 'wpautop');
remove_filter('the_content', 'wptexturize');

~ Matt

by
by
by
by
by
by