Skip to content

Commit

Permalink
++ release 2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kkasowski committed Nov 2, 2016
1 parent 87a46a6 commit 6d6ed1c
Show file tree
Hide file tree
Showing 24 changed files with 135 additions and 558 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
## Changelog

* 2.0.1 - 2016.11.2:
* Fix: Migration alert message.
* Fix: Updated Jigoshop logotypes.
* Fix: Admin Order and Product list search.
* Fix: Fatal error on admin order item variable template.
* Fix: Paypal response handling.
* Fix: Duplicatd foregin keys.
* Fix: Show add to cart button for free products.
* Fix: Change order status if payment is not required.
* Fix: Properly clear cart after checkout.
* Fix: Stock reports.
* Fix: Ajax product search.
* 2.0.0 - 2016.10.27:
* Full rewrite of core.
* Full rewrite of core.
2 changes: 1 addition & 1 deletion assets/css/admin/dashboard.css

Large diffs are not rendered by default.

Binary file modified assets/images/icons.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion jigoshop.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* Description: Jigoshop, a WordPress eCommerce plugin that works.
* Author: Jigoshop
* Author URI: http://www.jigoshop.com
* Version: 2.0
* Version: 2.0.1
* Requires at least: 4.0
* Tested up to: 4.6.1
* Text Domain: jigoshop
Expand Down
18 changes: 15 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
=== Jigoshop eCommerce ===
Contributors: Jigoshop
Contributors: jigoshop
Tags: ecommerce, wordpress ecommerce, store, shop, shopping, cart, checkout, widgets, reports, shipping, tax, paypal, jigowatt, shipping, inventory, stock, online, sell, sales, weights, dimensions, configurable, variable, downloadable, external, affiliate, download, virtual, physical
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&[email protected]&item_name=Donation+for+Jigoshop

Requires at least: 4.0
Tested up to: 4.6.1
Stable tag: 2.0
Stable tag: 2.0.1

A feature-packed eCommerce plugin built upon WordPress core functionality ensuring excellent performance and customizability.

Expand Down Expand Up @@ -113,5 +113,17 @@ However, if you want priority, dedicated support from Jigoshop staff, we dp offe

== Changelog ==

= 2.0-BETA =
= 2.0.1: =
* Fix: Migration alert message.
* Fix: Updated Jigoshop logotypes.
* Fix: Admin Order and Product list search.
* Fix: Fatal error on admin order item variable template.
* Fix: Paypal response handling.
* Fix: Duplicatd foregin keys.
* Fix: Show add to cart button for free products.
* Fix: Change order status if payment is not required.
* Fix: Properly clear cart after checkout.
* Fix: Stock reports.
* Fix: Ajax product search.
= 2.0 =
* Full rewrite of core
2 changes: 1 addition & 1 deletion src/Jigoshop/Admin/Migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function __construct(Wordpress $wp, Options $options, Messages $messages)
'i18n' => array(
'migration_complete' => __('migration complete', 'jigoshop'),
'migration_error' => __('migration error', 'jigoshop'),
'alert_msg' => __('Wystąpił błąd komunikacji, proszę przeładować stronę i koontynuować proces.', 'jigoshop'),
'alert_msg' => __('A communication error has occured, please reload the page and continue with the migration.', 'jigoshop'),
'processing' => __('Processing...', 'jigoshop'),
'jigoshop.admin.migration.products' => $migration_title . __('Products', 'jigoshop'),
'jigoshop.admin.migration.coupons' => $migration_title . __('Coupons', 'jigoshop'),
Expand Down
3 changes: 2 additions & 1 deletion src/Jigoshop/Admin/Reports/Chart/ByProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public function __construct(Wordpress $wp, Options $options, $currentRange)
Scripts::add('jigoshop.vendors.select2', \JigoshopInit::getUrl().'/assets/js/vendors/select2.js', array('jigoshop.admin'), array('in_footer' => true));
Scripts::add('jigoshop.admin.reports.widget.product_search', \JigoshopInit::getUrl().'/assets/js/admin/reports/widget/product_search.js', array(
'jquery',
'jigoshop.vendors.select2'
'jigoshop.vendors.select2',
'jigoshop.helpers.ajax_search'
), array('in_footer' => true));
Scripts::localize('jigoshop.reports.chart', 'chart_data', $this->getMainChart());
});
Expand Down
2 changes: 1 addition & 1 deletion src/Jigoshop/Admin/Reports/StockTab.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function getSlug()
*/
public function display()
{
Render::output('admin\reports\stock', array(
Render::output('admin/reports/stock', array(
'types' => $this->getTypes(),
'current_type' => $this->getCurrentType(),
'content' => $this->content
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ public function addServices(Services $services)
'jigoshop.options',
'jigoshop.messages',
));
$services->setDetails('jigoshop.api.paypal', 'Jigoshop\Payment\PayPal', array(
'wpal',
'di',
'jigoshop.options',
'jigoshop.messages',
));
$services->setDetails('jigoshop.payment.bank_transfer', 'Jigoshop\Payment\BankTransfer', array(
'wpal',
'jigoshop.options',
Expand Down
2 changes: 1 addition & 1 deletion src/Jigoshop/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class Core
{
const VERSION = '2.0';
const VERSION = '2.0.1';
const WIDGET_CACHE = 'jigoshop_widget_cache';
const TERMS = 'jigoshop_term';

Expand Down
6 changes: 3 additions & 3 deletions src/Jigoshop/Core/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,11 @@ class VARCHAR(255) NOT NULL,
meta_key VARCHAR(255) NOT NULL,
meta_value TEXT NOT NULL,
PRIMARY KEY id (id),
FOREIGN KEY product_attribute (product_id, attribute_id) REFERENCES {$wpdb->prefix}jigoshop_product_attribute (product_id, attribute_id) ON DELETE CASCADE
FOREIGN KEY product_attribute_ND (product_id, attribute_id) REFERENCES {$wpdb->prefix}jigoshop_product_attribute (product_id, attribute_id) ON DELETE CASCADE
) {$collate};
";
if (!$wpdb->query($query)) {
Registry::getInstance(JIGOSHOP_LOGGER)->addCritical(sprintf('Unable to create table "%s". Error: "%s".', 'jigoshop_product_attribute_meta', $wpdb->last_error));
Registry::getInstance()->addCritical(sprintf('Unable to create table "%s". Error: "%s".', 'jigoshop_product_attribute_meta', $wpdb->last_error));
echo __('Unable to create Jigoshop tables.', 'jigoshop');
exit;
}
Expand All @@ -260,7 +260,7 @@ class VARCHAR(255) NOT NULL,
attachment_id BIGINT(20) UNSIGNED NOT NULL,
type VARCHAR(50) NOT NULL,
FOREIGN KEY attachment (attachment_id) REFERENCES {$wpdb->posts} (ID) ON DELETE CASCADE,
FOREIGN KEY product (product_id) REFERENCES {$wpdb->posts} (ID) ON DELETE CASCADE
FOREIGN KEY product_nd (product_id) REFERENCES {$wpdb->posts} (ID) ON DELETE CASCADE
) {$collate};
";

Expand Down
5 changes: 4 additions & 1 deletion src/Jigoshop/Frontend/Page/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,10 @@ public function action()
$url = '';
if ($isPaymentRequired) {
$url = $payment->process($order);
}
} else {
$order->setStatus(\Jigoshop\Helper\Order::getStatusAfterCompletePayment($order));
$this->orderService->save($order);
}

// Redirect to thank you page
if (empty($url)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Jigoshop/Helper/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public static function printAddToCartForm($product, $template)
{
if ($product instanceof Entity\Product\Purchasable) {
$price = $product->getRegularPrice();
if (empty($price)) {
if ($price === '') {
return;
}
}
Expand Down
94 changes: 75 additions & 19 deletions src/Jigoshop/Query/Interceptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function menu($items)

public function intercept($request)
{
if ($this->intercepted || $this->wp->isAdmin()) {
if ($this->intercepted) {
return $request;
}
$this->intercepted = true;
Expand All @@ -82,30 +82,39 @@ public function intercept($request)

private function parseRequest($request)
{
if ($this->isCart($request)) {
return $this->wp->applyFilters('jigoshop\query\cart', $request, $request);
}
if(is_admin() == false) {
if ($this->isCart($request)) {
return $this->wp->applyFilters('jigoshop\query\cart', $request, $request);
}

if ($this->isProductCategory($request)) {
return $this->getProductCategoryListQuery($request);
}

if ($this->isProductCategory($request)) {
return $this->getProductCategoryListQuery($request);
}
if ($this->isProductTag($request)) {
return $this->getProductTagListQuery($request);
}

if ($this->isProductTag($request)) {
return $this->getProductTagListQuery($request);
}
if ($this->isProductList($request)) {
return $this->getProductListQuery($request);
}

if ($this->isProductList($request)) {
return $this->getProductListQuery($request);
}
if ($this->isProduct($request)) {
return $this->getProductQuery($request);
}

if ($this->isProduct($request)) {
return $this->getProductQuery($request);
}
if ($this->isAccount($request)) {
return $this->wp->applyFilters('jigoshop\query\account', $request, $request);
}
} else {
if ($this->isAdminOrderList($request)) {
return $this->getAdminOrderListQuery($request);
}

if ($this->isAccount($request)) {
return $this->wp->applyFilters('jigoshop\query\account', $request, $request);
}
if ($this->isAdminProductList($request)) {
return $this->getAdminProductListQuery($request);
}
}

return $request;
}
Expand Down Expand Up @@ -222,4 +231,51 @@ private function isAccount($request)
{
return isset($request['pagename']) && $request['pagename'] == Pages::SHOP;
}

private function isAdminOrderList($request)
{
return $this->wp->getPageNow() == 'edit.php' && isset($request['post_type']) && $request['post_type'] == Types::ORDER;
}

private function getAdminOrderListQuery($request)
{
if(isset($request['s'])) {
$wpdb = $this->wp->getWPDB();
$ids = $wpdb->get_results($wpdb->prepare("SELECT posts.ID as ID FROM {$wpdb->posts} as posts
INNER JOIN {$wpdb->postmeta} as meta ON (meta.post_id = posts.ID AND meta.meta_key = 'number')
INNER JOIN {$wpdb->postmeta} as meta2 ON (meta2.post_id = posts.ID AND meta2.meta_key = 'customer')
WHERE meta.meta_value LIKE %s OR meta2.meta_value LIKE %s OR posts.ID = %d",
'%'.$request['s'].'%', '%:"%'.$request['s'].'%";%', $request['s']), ARRAY_A);

unset($request['s']);
unset($request['m']);
$request['post__in'] = array_map(function($item){ return $item['ID']; }, $ids);
$request['post__in'] = count($request['post__in']) ? $request['post__in'] : [0];
}

return $request;
}

private function isAdminProductList($request)
{
return $this->wp->getPageNow() == 'edit.php' && isset($request['post_type']) && $request['post_type'] == Types::PRODUCT;
}

private function getAdminProductListQuery($request)
{
if(isset($request['s'])) {
$wpdb = $this->wp->getWPDB();
$ids = $wpdb->get_results($wpdb->prepare("SELECT posts.ID as ID FROM {$wpdb->posts} as posts
INNER JOIN {$wpdb->postmeta} as meta ON (meta.post_id = posts.ID AND meta.meta_key = 'sku')
WHERE meta.meta_value LIKE %s OR posts.post_title LIKE %s OR posts.post_content LIKE %s OR posts.ID = %d",
'%'.$request['s'].'%', '%'.$request['s'].'%', '%'.$request['s'].'%', $request['s']), ARRAY_A);

unset($request['s']);
unset($request['m']);
$request['post__in'] = array_map(function($item){ return $item['ID']; }, $ids);
$request['post__in'] = count($request['post__in']) ? $request['post__in'] : [0];
}

return $request;
}
}
2 changes: 1 addition & 1 deletion src/Jigoshop/Service/CartService.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ public function remove(Cart $cart)
{
$session = $this->session->getField(self::CART);
if (isset($session[$cart->getId()])) {
unset($session[self::CART][$cart->getId()]);
unset($session[$cart->getId()]);
$this->session->setField(self::CART, $session);
}
}
Expand Down
4 changes: 2 additions & 2 deletions templates/admin/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<form action="admin-post.php" method="post">
<h3><?php _e('Jigoshop Dashboard', 'jigoshop'); ?></h3>

<p id="wp-version-message"><?php _e('You are using', 'jigoshop'); ?>
<strong>Jigoshop <?php echo \Jigoshop\Core::VERSION; ?></strong>
<p id="wp-version-message"><?php _e('You are using version: ', 'jigoshop'); ?>
<strong><?php echo \Jigoshop\Core::VERSION; ?></strong>
</p>

<?php wp_nonce_field('jigoshop-metaboxes-main'); ?>
Expand Down
3 changes: 2 additions & 1 deletion templates/admin/order/item/variable.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
$id = $item->getKey();
/** @var \Jigoshop\Entity\Product\Variable $product */
$product = $item->getProduct();
$variation = $product->getVariation($item->getMeta('variation_id')->getValue());
$meta = $item->getMeta('variation_id');
$variation = $meta ? $product->getVariation($meta->getValue()) : null;
$product = $variation ? $variation->getProduct() : $product;
?>
<tr data-id="<?php echo $id; ?>" data-product="<?php echo $product->getId(); ?>">
Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

require_once __DIR__ . '/composer' . '/autoload_real.php';

return ComposerAutoloaderInit3e7a2d6076e1f6e38f06dce83d516d8d::getLoader();
return ComposerAutoloaderInit46b3dadc56d92e78c448a6861b4a4a45::getLoader();
10 changes: 5 additions & 5 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInit3e7a2d6076e1f6e38f06dce83d516d8d
class ComposerAutoloaderInit46b3dadc56d92e78c448a6861b4a4a45
{
private static $loader;

Expand All @@ -19,9 +19,9 @@ public static function getLoader()
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInit3e7a2d6076e1f6e38f06dce83d516d8d', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit46b3dadc56d92e78c448a6861b4a4a45', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit3e7a2d6076e1f6e38f06dce83d516d8d', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit46b3dadc56d92e78c448a6861b4a4a45', 'loadClassLoader'));

$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
Expand All @@ -42,14 +42,14 @@ public static function getLoader()

$includeFiles = require __DIR__ . '/autoload_files.php';
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire3e7a2d6076e1f6e38f06dce83d516d8d($fileIdentifier, $file);
composerRequire46b3dadc56d92e78c448a6861b4a4a45($fileIdentifier, $file);
}

return $loader;
}
}

function composerRequire3e7a2d6076e1f6e38f06dce83d516d8d($fileIdentifier, $file)
function composerRequire46b3dadc56d92e78c448a6861b4a4a45($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
Expand Down
Loading

0 comments on commit 6d6ed1c

Please sign in to comment.