From b6b0487610c1df1e2d1d14defbfe637ebef68910 Mon Sep 17 00:00:00 2001 From: Krzysztof Kasowski Date: Wed, 22 Mar 2017 13:21:44 +0100 Subject: [PATCH] release 2.0.10.2 --- CHANGELOG.md | 7 ++++++- jigoshop.php | 2 +- readme.txt | 6 ++++++ src/Jigoshop/Admin/Page/Order.php | 14 ++------------ src/Jigoshop/Admin/Reports/SalesTab.php | 11 ++++++++++- src/Jigoshop/Core.php | 2 +- src/Jigoshop/Entity/Cart.php | 15 +++++++++++++++ src/Jigoshop/Factory/Product.php | 4 ++-- 8 files changed, 43 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 101fcdb3..30b12896 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ## Changelog - +* 2.0.10.2 - 2017.03.22: + * Fix: Sanitized product title on product save in Wordpress panel. + * Fix: Post excerpt was saved as product description. + * Fix: Fatal error on Order page when DOMDocument is missing. + * Fix: Discounts not being removed. + * Disabled: Discount Summary report due to serious issue. * 2.0.10.1 - 2017.03.21: * Fix: Fatal error on product save. * 2.0.10 - 2017.03.21: diff --git a/jigoshop.php b/jigoshop.php index 9edc90f9..af8cc479 100755 --- a/jigoshop.php +++ b/jigoshop.php @@ -20,7 +20,7 @@ * Description: Jigoshop, a WordPress eCommerce plugin that works. * Author: Jigoshop * Author URI: http://www.jigoshop.com - * Version: 2.0.10.1 + * Version: 2.0.10.2 * Requires at least: 4.0 * Tested up to: 4.7.3 * Text Domain: jigoshop diff --git a/readme.txt b/readme.txt index 59026232..b35a972c 100755 --- a/readme.txt +++ b/readme.txt @@ -151,6 +151,12 @@ However, if you want priority, dedicated support from Jigoshop staff, we dp offe == Changelog == += 2.0.10.2 - 2017.03.22 = +* Fix: Sanitized product title on product save in Wordpress panel. +* Fix: Post excerpt was saved as product description. +* Fix: Fatal error on Order page when DOMDocument is missing. +* Fix: Discounts not being removed. +* Disabled: Discount Summary report due to serious issue. = 2.0.10.1 - 2017.03.21 = * Fix: Fatal error on product save. = 2.0.10 - 2017.03.21 = diff --git a/src/Jigoshop/Admin/Page/Order.php b/src/Jigoshop/Admin/Page/Order.php index a86c26a4..c5cf7226 100755 --- a/src/Jigoshop/Admin/Page/Order.php +++ b/src/Jigoshop/Admin/Page/Order.php @@ -648,18 +648,8 @@ public function actionsBox() private function renderModifiedPublishBoxContent($post) { - ob_start(); post_submit_meta_box($post); - $html = ob_get_clean(); - $doc = new \DOMDocument(); - $doc->loadHTML($html); - $element = $doc->getElementById('minor-publishing'); - $element->removeChild($doc->getElementById('minor-publishing-actions')); - $doc->getElementById('minor-publishing')->parentNode->removeChild($doc->getElementById('major-publishing-actions')); - $element = $doc->getElementById('misc-publishing-actions'); - $element->removeChild($doc->getElementById('visibility')); - $element->removeChild($element->getElementsByTagName('div')->item(0)); - - echo $doc->saveHTML(); + //TODO: move it to CSS file. + echo ''; } } diff --git a/src/Jigoshop/Admin/Reports/SalesTab.php b/src/Jigoshop/Admin/Reports/SalesTab.php index dfea9891..83fcf952 100755 --- a/src/Jigoshop/Admin/Reports/SalesTab.php +++ b/src/Jigoshop/Admin/Reports/SalesTab.php @@ -5,6 +5,7 @@ use Jigoshop\Admin\Reports; use Jigoshop\Core\Options; use Jigoshop\Helper\Render; +use Jigoshop\Integration; use WPAL\Wordpress; class SalesTab implements TabInterface @@ -25,6 +26,14 @@ public function __construct(Wordpress $wp, Options $options) if (in_array($this->wp->getPageNow(), array('admin.php', 'options.php')) && isset($_GET['page']) && $_GET['page'] == Reports::NAME ) { + add_action( 'admin_notices', function(){ + ?> +
+

+
+ chart = $this->getChart(); } } @@ -63,7 +72,7 @@ private function getTypes() 'by_date' => __('By Date', 'jigoshop'), 'by_product' => __('By Product', 'jigoshop'), 'by_category' => __('By Category', 'jigoshop'), - 'discount_summary' => __('Discount Summary', 'jigoshop') + //'discount_summary' => __('Discount Summary', 'jigoshop') )); } diff --git a/src/Jigoshop/Core.php b/src/Jigoshop/Core.php index 1d7a67b7..0d67b41c 100755 --- a/src/Jigoshop/Core.php +++ b/src/Jigoshop/Core.php @@ -13,7 +13,7 @@ class Core { - const VERSION = '2.0.10.1'; + const VERSION = '2.0.10.2'; const WIDGET_CACHE = 'jigoshop_widget_cache'; const TERMS = 'jigoshop_term'; diff --git a/src/Jigoshop/Entity/Cart.php b/src/Jigoshop/Entity/Cart.php index 69c06295..db0b4269 100755 --- a/src/Jigoshop/Entity/Cart.php +++ b/src/Jigoshop/Entity/Cart.php @@ -245,13 +245,28 @@ public function removeAllCouponsExcept($codes) } } + /** + * @return array + */ public function getStateToSave() { $state = parent::getStateToSave(); $state['items'] = serialize($state['items']); + $state['coupon_data'] = serialize($this->couponData); unset($state['update_messages'], $state['updated_at'], $state['completed_at'], $state['total'], $state['subtotal']); return $state; } + + /** + * @param array $state + */ + public function restoreState(array $state) + { + parent::restoreState($state); + if(isset($state['coupon_data'])) { + $this->couponData = maybe_unserialize($state['coupon_data']); + } + } } diff --git a/src/Jigoshop/Factory/Product.php b/src/Jigoshop/Factory/Product.php index b724edaa..4f30298d 100755 --- a/src/Jigoshop/Factory/Product.php +++ b/src/Jigoshop/Factory/Product.php @@ -103,8 +103,8 @@ public function create($id) if (!empty($_POST)) { $helpers = $this->wp->getHelpers(); - $product->setName($helpers->sanitizeTitle($_POST['post_title'])); - $product->setDescription($helpers->parsePostBody($_POST['post_excerpt'])); + $product->setName($_POST['post_title']); + $product->setDescription($helpers->parsePostBody($_POST['post_content'])); $_POST['product']['categories'] = $this->getTerms($id, Types::PRODUCT_CATEGORY, $this->wp->getTerms(Types::PRODUCT_CATEGORY, array( 'posts__in' => $_POST['tax_input']['product_category'], )));