Plugin Directory

Changeset 1491650


Ignore:
Timestamp:
09/07/2016 09:38:12 AM (10 years ago)
Author:
zibbra
Message:

updates

Location:
zibbra/trunk
Files:
10 added
7 edited

Legend:

Unmodified
Added
Removed
  • zibbra/trunk/core/controller.php

    r1474412 r1491650  
    119119        add_action("wp_head", array($this, "register_ga"));
    120120        add_action("wp_head", array($this, "register_fb"));
     121        add_action("pre_get_posts", array($this, "pre_get_posts"));
    121122       
    122123        // Register filters
     
    334335       
    335336    } // end function
     337
     338    public function pre_get_posts(WP_Query $query) {
     339
     340        // Disable loading of any posts when in Zibbra pages
     341
     342        if(!is_admin() && $query->is_main_query()) {
     343
     344            $query->query_vars['cat'] = -1;
     345
     346        } // end if
     347
     348        // Custom search => set post type to zibbra so our custom module is loaded
     349
     350        if(!is_admin() && $query->is_main_query() && $query->is_search()) {
     351
     352            $query->set("type", "zibbra");
     353
     354        } // end if
     355
     356    } // end function
    336357   
    337358    public function generate_rewrite_rules(WP_Rewrite $wp_rewrite) {
     
    589610           
    590611        return $template;
    591        
    592 //      if($wp_query->is_search) {
    593 //
    594 //          exit("SEARCH: ".$wp_query->query['s']);
    595 //
    596 //      } // end if
    597 //
    598 //      return false;
    599612   
    600613    } // end function
     
    608621        // Get the template slug
    609622       
    610         $template = rtrim($template, ".php").(!empty($slug) ? "-".$slug : "").".php";
     623        $template = preg_replace("/\.php$/", "", $template).(!empty($slug) ? "-".$slug : "").".php";
    611624   
    612625        // Check if a custom template exists in the theme folder, if not, load the plugin template file
  • zibbra/trunk/modules/abstract.php

    r1308807 r1491650  
    2323        $module_name = $this->getName();
    2424
    25         add_filter("the_title",function ($old_title) use($title, $module_name) {
     25        add_filter("the_title",function ($old_title, $id) use($title, $module_name) {
     26
     27            if(is_zibbra() && $id==0) {
     28
     29                return $title;
     30
     31            } // end if
    2632           
    27             return $old_title==$module_name ? $title : $old_title;
     33            return $old_title;
    2834       
    29         }); // end add_filter
     35        }, 10, 2); // end add_filter
    3036       
    31         add_filter("wp_title", function ($old_title) use($title, $module_name) {
     37        add_filter("wp_title", function ($old_title) use($title) {
    3238           
    3339            return $title." | ".$old_title;
  • zibbra/trunk/readme.txt

    r1487906 r1491650  
    11=== Zibbra ===
    2 Requires at least: 4.3.1
     2Requires at least: 4.5.0
    33Tested up to: 4.6.0
    44Contributors: Zibbra
    55Tags: Ecommerce, Cloud
    6 Stable tag: 1.3.6
     6Stable tag: 1.4.0
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5151
    5252== Changelog ==
     53
     54= 1.4.0 =
     55
     56* New widgets
     57* Small improvements
     58* Custom search
    5359
    5460= 1.3.6 =
  • zibbra/trunk/tags/templates.php

    r1308807 r1491650  
    7272} // end function
    7373
     74function is_zibbra_account() {
     75
     76    return Zibbra_Plugin_Controller::getInstance()->getActiveModule() instanceof Zibbra_Plugin_Module_Account;
     77
     78} // end function
     79
     80function is_zibbra_brand() {
     81
     82    return Zibbra_Plugin_Controller::getInstance()->getActiveModule() instanceof Zibbra_Plugin_Module_Brand;
     83
     84} // end function
     85
     86function is_zibbra_cart() {
     87
     88    return Zibbra_Plugin_Controller::getInstance()->getActiveModule() instanceof Zibbra_Plugin_Module_Cart;
     89
     90} // end function
     91
     92function is_zibbra_catalog() {
     93
     94    return Zibbra_Plugin_Controller::getInstance()->getActiveModule() instanceof Zibbra_Plugin_Module_Catalog;
     95
     96} // end function
     97
     98function is_zibbra_checkout() {
     99
     100    return Zibbra_Plugin_Controller::getInstance()->getActiveModule() instanceof Zibbra_Plugin_Module_Checkout;
     101
     102} // end function
     103
     104function is_zibbra_login() {
     105
     106    return Zibbra_Plugin_Controller::getInstance()->getActiveModule() instanceof Zibbra_Plugin_Module_Login;
     107
     108} // end function
     109
     110function is_zibbra_payment() {
     111
     112    return Zibbra_Plugin_Controller::getInstance()->getActiveModule() instanceof Zibbra_Plugin_Module_Payment;
     113
     114} // end function
     115
     116function is_zibbra_product() {
     117
     118    return Zibbra_Plugin_Controller::getInstance()->getActiveModule() instanceof Zibbra_Plugin_Module_Product;
     119
     120} // end function
     121
     122function is_zibbra_register() {
     123
     124    return Zibbra_Plugin_Controller::getInstance()->getActiveModule() instanceof Zibbra_Plugin_Module_Register;
     125
     126} // end function
     127
     128function is_zibbra_reset() {
     129
     130    return Zibbra_Plugin_Controller::getInstance()->getActiveModule() instanceof Zibbra_Plugin_Module_Reset;
     131
     132} // end function
     133
     134function is_zibbra_shipping() {
     135
     136    return Zibbra_Plugin_Controller::getInstance()->getActiveModule() instanceof Zibbra_Plugin_Module_Shipping;
     137
     138} // end function
     139
    74140?>
  • zibbra/trunk/tags/widgets.php

    r1474412 r1491650  
    4242
    4343} // end function
    44 
    45 ?>
  • zibbra/trunk/templates/catalog-filters.php

    r1308807 r1491650  
    77?>
    88<?php foreach($filters as $filter): ?>
    9     <div id="<?php echo $filter->getField(); ?>" class="zibbra-filter <?php echo $filter->getType(); ?>">
    10         <?php if($filter->getType()==ZProductFilter::TYPE_RANGE && $filter->getMin()!=$filter->getMax()): ?>
     9    <?php if($filter->getType()==ZProductFilter::TYPE_RANGE && $filter->hasMinMax() && $filter->getMin()!=$filter->getMax()): ?>
     10        <div id="<?php echo $filter->getField(); ?>" class="zibbra-filter <?php echo $filter->getType(); ?>">
    1111            <h3 class="header"><span><?php echo $filter->getName(); ?></span></h3>
    1212            <div class="range">
     
    1515                <div id="<?php echo $filter->getField(); ?>_range" class="slider noUi-extended" data-prefix="&euro;" data-field="<?php echo $filter->getField(); ?>" data-min="<?php echo floor(round($filter->getMin(),2)); ?>" data-max="<?php echo ceil($filter->getMax()); ?>" data-value-min="<?php echo floor(round($filter->getMin(),2)); ?>" data-value-max="<?php echo ceil($filter->getMax()); ?>"></div>
    1616            </div>
    17         <?php endif; ?>
    18         <?php if($filter->getType()==ZProductFilter::TYPE_LIST && count($filter->getOptions())>0): ?>
     17        </div>
     18    <?php endif; ?>
     19    <?php if($filter->getType()==ZProductFilter::TYPE_LIST && count($filter->getOptions())>0): ?>
     20        <div id="<?php echo $filter->getField(); ?>" class="zibbra-filter <?php echo $filter->getType(); ?>">
    1921            <h3 class="header"><span><?php echo $filter->getName(); ?></span><div class="icon"></div></h3>
    2022            <div id="<?php echo $filter->getField(); ?>_list" class="list">
     
    2527                <div class="clearfix"></div>
    2628            </div>
    27         <?php endif; ?>
    28     </div>
     29        </div>
     30    <?php endif; ?>
    2931<?php endforeach; ?>
    3032<?php if(ZIBBRA_SHOW_STOCK): ?>
  • zibbra/trunk/zibbra.php

    r1487906 r1491650  
    66 * Plugin URI: http://wordpress.org/plugins/zibbra/
    77 * Description: Zibbra integration plugin for Wordpress
    8  * Version: 1.3.6
     8 * Version: 1.4.0
    99 * Author: Zibbra
    1010 * Author URI: https://www.zibbra.com
     
    5151require_once(ZIBBRA_BASE_DIR."/modules/register.php");
    5252require_once(ZIBBRA_BASE_DIR."/modules/reset.php");
     53require_once(ZIBBRA_BASE_DIR."/modules/search.php");
    5354require_once(ZIBBRA_BASE_DIR."/modules/shipping.php");
    5455require_once(ZIBBRA_BASE_DIR."/modules/sitemap.php");
     
    5960require_once(ZIBBRA_BASE_DIR."/widgets/minicart.php");
    6061require_once(ZIBBRA_BASE_DIR."/widgets/bestsellers.php");
     62require_once(ZIBBRA_BASE_DIR."/widgets/category.php");
     63require_once(ZIBBRA_BASE_DIR."/widgets/filters.php");
    6164require_once(ZIBBRA_BASE_DIR."/widgets/newsletter.php");
    6265require_once(ZIBBRA_BASE_DIR."/widgets/login.php");
     
    8184        const FORM_ACTION = "zibbra";
    8285        const ROLE = "customer";
    83         const VERSION = "1.3.6";
     86        const VERSION = "1.4.0";
    8487       
    8588        private $controller = null;
Note: See TracChangeset for help on using the changeset viewer.