Skip to content

Commit

Permalink
release 2.1.4 fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
kkasowski committed Jun 14, 2017
1 parent 902b3b5 commit bc4c301
Show file tree
Hide file tree
Showing 12 changed files with 92 additions and 29 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Changelog
* 2.1.4 - 2017.06.13:
* 2.1.4 - 2017.06.14:
* New: Email action for order status change for admin.
* New: Possibility to show prices with and without tax.
* New: All Forms now has data parameter.
Expand All @@ -10,6 +10,10 @@
* Fix: PayPal error when order amount was more than 999.
* Fix: E-mail footer not included in Jigoshop emails.
* Fix: Non-existent tax classes supplied to TaxService.
* Fix: Not possible to disable stock manage in product variation.
* Fix: Price filter widget, do not allow to set the same price as min and max.
* Fix: Fatal error when up-sell or cross-sell product was deleted.
* Fix: Do not return null in ajax product find when id doesn't math any product.
* 2.1.3 - 2017.05.25:
* New: Allow to prepend product permalink with Wordpress permalink.
* New: Tool to fix order items migration.
Expand Down
2 changes: 1 addition & 1 deletion assets/js/admin/product/variable.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions assets/js/vendors/bs_tab_trans_tooltip_collapse.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions assets/js/vendors/flot.js

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,25 @@ However, if you want priority, dedicated support from Jigoshop staff, we dp offe

== Changelog ==

= 2.1.4 - 2017.06.14 =
* New: Email action for order status change for admin.
* New: Possibility to show prices with and without tax.
* New: All Forms now has data parameter.
* New: Shipping and Payment interfaces.
* Fix: Do not allow to add to cart variations with not enough stock.
* Fix: Show only selected attribute options for specified variable product.
* Fix: Api responses now properly includes result counts, next and prev paths, created/updated objects.
* Fix: PayPal error when order amount was more than 999.
* Fix: E-mail footer not included in Jigoshop emails.
* Fix: Non-existent tax classes supplied to TaxService.
* Fix: Not possible to disable stock manage in product variation.
* Fix: Price filter widget, do not allow to set the same price as min and max.
= 2.1.3 - 2017.05.25 =
* New: Allow to prepend product permalink with Wordpress permalink.
* New: Tool to fix order items migration.
* Fix: Fatal error on order edit page caused by Free shipping.
* Fix: Properly migrate order items.
* Fix: Discount migration.
= 2.1.2 - 2017.05.11 =
* New: Possibility to get country code in ISO 3166-1 alfa-3 standard.
* Fix: Properly display custom settings tabs.
Expand Down
4 changes: 4 additions & 0 deletions src/Jigoshop/Admin/Page/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,10 @@ public function ajaxFindProduct()
throw new Exception(__('Neither query nor value is provided to find products.', 'jigoshop'));
}

$products = array_filter($products, function($product) {
return $product instanceof \Jigoshop\Entity\Product;
});

$result = [
'success' => true,
'results' => $this->prepareResults($products, isset($_POST['only_parent']) && (bool)$_POST['only_parent']),
Expand Down
6 changes: 4 additions & 2 deletions src/Jigoshop/Admin/Settings/TaxesTab.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ public function getSections()
'options' => [
'including_tax' => __('Including tax', 'jigoshop'),
'excluding_tax' => __('Excluding tax', 'jigoshop'),
'both' => __('Both', 'jigoshop')
'both_including_first' => __('Both (including tax first)', 'jigoshop'),
'both_excluding_first' => __('Both (excluding tax first)', 'jigoshop')
]
],
[
Expand All @@ -166,7 +167,8 @@ public function getSections()
'options' => [
'including_tax' => __('Including tax', 'jigoshop'),
'excluding_tax' => __('Excluding tax', 'jigoshop'),
'both' => __('Both', 'jigoshop')
'both_including_first' => __('Both (including tax first)', 'jigoshop'),
'both_excluding_first' => __('Both (excluding tax first)', 'jigoshop')
]
],
[
Expand Down
6 changes: 5 additions & 1 deletion src/Jigoshop/Frontend/Page/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,12 @@ public function crossSells()
if (sizeof($products) >= $limit) {
break;
}
$products[] = $this->productService->find($id);
$product = $this->productService->find($id);
if($product instanceof \Jigoshop\Entity\Product) {
$products[] = $this->productService->find($id);
}
}

if(count($products)) {
Render::output('shop/cart/cross_sells', [
'products' => $products,
Expand Down
5 changes: 4 additions & 1 deletion src/Jigoshop/Frontend/Page/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,10 @@ public function upSells($product)
if(sizeof($products) >= $productCount){
break;
}
$products[] = $this->productService->find($id);
$product = $this->productService->find($id);
if($product instanceof \Jigoshop\Entity\Product) {
$products[] = $this->productService->find($id);
}
}

Render::output('shop/product/up_sells', [
Expand Down
53 changes: 40 additions & 13 deletions src/Jigoshop/Helper/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public static function getPriceHtml(Entity\Product $product) {
$result = sprintf('
<del>%s
%s</del>
%s
<strong>%s</strong>
%s
<ins>%s</ins>
', $pricesRegular[0], $pricesRegular[1],
Expand All @@ -110,7 +110,7 @@ public static function getPriceHtml(Entity\Product $product) {
$result = sprintf('
<del>%s
%s</del>
%s
<strong>%s</strong>
%s
', $pricesRegular[0], $pricesRegular[1],
$salePrices[0], $salePrices[1]);
Expand All @@ -128,7 +128,7 @@ public static function getPriceHtml(Entity\Product $product) {
$prices = self::generatePrices($price, $priceWithTax);

if(count($prices) == 2) {
$result = sprintf('%s
$result = sprintf('<strong>%s</strong>
(%s)', $prices[0], $prices[1]);
}
else {
Expand All @@ -137,25 +137,44 @@ public static function getPriceHtml(Entity\Product $product) {

break;
case Entity\Product\Variable::TYPE:
$price = $product->getLowestPrice();
$price = false;
$lowestVariation = false;
foreach($product->getVariations() as $variation) {
$variationPrice = $variation->getProduct()->getPrice();

if($variationPrice < $price || $price === false) {
$price = $variationPrice;
$lowestVariation = $variation;
}
}

if($lowestVariation !== false) {
$product = $lowestVariation->getProduct();
}

$price = ($taxAlreadyIncluded == 'with_tax'?Tax::getPriceWithoutTax($price, $product->getTaxClasses()):$price);
$priceWithTax = $price + Tax::getForProduct($price, $product);

$prices = self::generatePrices($price, $priceWithTax);

if($price !== '' && $product->getLowestPrice() < $product->getHighestPrice()) {
if($price !== '') {
if(count($prices) == 2) {
$result = sprintf(__('From: %s
$result = sprintf(__('From: <strong>%s</strong>
(%s)', 'jigoshop'), $prices[0], $prices[1]);
}
else {
$result = sprintf(__('From: %s', 'jigoshop'), $prices[0]);
}
}
else {
$result = $prices[0];
if(count($prices) == 2) {
$result = sprintf(__('<strong>%s</strong>
(%s)', 'jigoshop'), $prices[0], $prices[1]);
}
else {
$result = $prices[0];
}
}

break;
default:
$result = apply_filters('jigoshop\helper\product\get_price', '', $product);
Expand Down Expand Up @@ -184,17 +203,25 @@ public static function generatePrices($price, $priceWithTax, $cart = 0) {
''
];
}
if($showWithTax == 'both') {
if($showWithTax == 'both_including_first' || $showWithTax == 'both_excluding_first') {
if($price == 0.00) {
return [
self::formatPrice(0.00)
];
}
else {
return [
self::formatPrice(round($price, 2), $suffixExcludingTax),
self::formatPrice(round($priceWithTax, 2), $suffixIncludingTax)
];
if($showWithTax == 'both_excluding_first') {
return [
self::formatPrice(round($price, 2), $suffixExcludingTax),
self::formatPrice(round($priceWithTax, 2), $suffixIncludingTax)
];
}
else {
return [
self::formatPrice(round($priceWithTax, 2), $suffixIncludingTax),
self::formatPrice(round($price, 2), $suffixExcludingTax)
];
}
}
}
else {
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 ComposerAutoloaderInit82d0a7c2a0081d8fad06978d931860c2::getLoader();
return ComposerAutoloaderInit15d30e75e9d141b07c40235f713ee619::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 ComposerAutoloaderInit82d0a7c2a0081d8fad06978d931860c2
class ComposerAutoloaderInit15d30e75e9d141b07c40235f713ee619
{
private static $loader;

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

spl_autoload_register(array('ComposerAutoloaderInit82d0a7c2a0081d8fad06978d931860c2', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit15d30e75e9d141b07c40235f713ee619', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit82d0a7c2a0081d8fad06978d931860c2', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit15d30e75e9d141b07c40235f713ee619', '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) {
composerRequire82d0a7c2a0081d8fad06978d931860c2($fileIdentifier, $file);
composerRequire15d30e75e9d141b07c40235f713ee619($fileIdentifier, $file);
}

return $loader;
}
}

function composerRequire82d0a7c2a0081d8fad06978d931860c2($fileIdentifier, $file)
function composerRequire15d30e75e9d141b07c40235f713ee619($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
Expand Down

0 comments on commit bc4c301

Please sign in to comment.