Skip to content

Commit

Permalink
Merge pull request #117 from PrestaShop/dev
Browse files Browse the repository at this point in the history
Release version 2.0.1
  • Loading branch information
jolelievre authored May 27, 2021
2 parents 82e6992 + 762cd60 commit 51d5277
Show file tree
Hide file tree
Showing 12 changed files with 116 additions and 92 deletions.
23 changes: 23 additions & 0 deletions _dev/front/js/components/Delete/Delete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
required: true,
default: 'Delete',
},
titleList: {
type: String,
required: true,
default: 'Delete',
},
placeholder: {
type: String,
required: true,
Expand All @@ -57,16 +62,33 @@
required: true,
default: 'Delete',
},
deleteTextList: {
type: String,
required: true,
default: 'Delete',
},
},
data() {
return {
value: '',
isHidden: true,
listId: null,
listName: '',
productId: null,
productAttributeId: null,
};
},
computed: {
confirmMessage() {
return this.placeholder.replace('%nameofthewishlist%', this.listName);
},
modalTitle() {
return this.productId ? this.title : this.titleList;
},
modalDeleteText() {
return this.productId ? this.deleteText : this.deleteTextList;
},
},
methods: {
/**
* Toggle the modal
Expand Down Expand Up @@ -120,6 +142,7 @@
EventBus.$on('showDeleteWishlist', (event) => {
this.value = '';
this.listId = event.detail.listId;
this.listName = event.detail.listName;
this.productId = null;
this.productAttributeId = null;
Expand Down
8 changes: 8 additions & 0 deletions _dev/front/js/components/Delete/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ const props = [
name: 'title',
type: String,
},
{
name: 'titleList',
type: String,
},
{
name: 'placeholder',
type: String,
Expand All @@ -44,6 +48,10 @@ const props = [
name: 'deleteText',
type: String,
},
{
name: 'deleteTextList',
type: String,
},
];

initApp(Delete, '.wishlist-delete', props);
15 changes: 15 additions & 0 deletions _dev/front/js/components/Product/Product.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@
'wishlist-product-unavailable': !product.add_to_cart_url
}"
>
<img
v-else-if="product.cover"
:src="product.cover.large.url"
:alt="product.cover.legend"
:title="product.cover.legend"
:class="{
'wishlist-product-unavailable': !product.add_to_cart_url
}"
>
<img
v-else
:src="prestashop.urls.no_picture_image.bySize.home_default.url"
Expand Down Expand Up @@ -175,6 +184,11 @@
required: true,
default: null,
},
listName: {
type: String,
required: true,
default: '',
},
isShare: {
type: Boolean,
required: false,
Expand Down Expand Up @@ -227,6 +241,7 @@
EventBus.$emit('showDeleteWishlist', {
detail: {
listId: this.listId,
listName: this.listName,
productId: this.product.id,
productAttributeId: this.product.id_product_attribute,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
:add-to-cart="addToCart"
:customize-text="customizeText"
:quantity-text="quantityText"
:list-name="title"
:list-id="
listId ? listId : parseInt(currentWishlist.id_wishlist, 10)
"
Expand Down
6 changes: 3 additions & 3 deletions blockwishlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function __construct()
{
$this->name = 'blockwishlist';
$this->tab = 'front_office_features';
$this->version = '2.0.0';
$this->version = '2.0.1';
$this->author = 'PrestaShop';
$this->need_instance = 0;

Expand Down Expand Up @@ -151,15 +151,15 @@ public function hookActionFrontControllerSetMedia(array $params)
'modules/' . $this->name . '/public/wishlist.css',
[
'media' => 'all',
'priority' => 200,
'priority' => 100,
]
);

$this->context->controller->registerJavascript(
'blockwishlistController',
'modules/' . $this->name . '/public/product.bundle.js',
[
'priority' => 200,
'priority' => 100,
]
);
}
Expand Down
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<module>
<name>blockwishlist</name>
<displayName><![CDATA[Wishlist block]]></displayName>
<version><![CDATA[2.0.0]]></version>
<version><![CDATA[2.0.1]]></version>
<description><![CDATA[Adds a block containing the customer&#039;s wishlists.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
Expand Down
2 changes: 1 addition & 1 deletion controllers/front/action.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private function addProductToWishListAction($params)
return $this->ajaxRender(
json_encode([
'success' => false,
'message' => $this->trans('There was an error adding the product attributes', [], 'Modules.Blockwishlist.Shop'),
'message' => $this->trans('There was an error while adding the product attributes', [], 'Modules.Blockwishlist.Shop'),
])
);
}
Expand Down
117 changes: 46 additions & 71 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 51d5277

Please sign in to comment.