Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BO create order part-3. Implement vouchers managing #15995

Merged
merged 11 commits into from Oct 21, 2019

Conversation

@zuk3975
Copy link
Contributor

zuk3975 commented Oct 17, 2019

Questions Answers
Branch? develop
Description? Implement cart rules/vouchers searching and adding to cart/deleting via ajax in create order page of BO. Introduces TranslatedException (for exceptions with translated messages which supposed to be displayed straight to end-user)
Type? refacto
Category? BO
BC breaks? no
Deprecations? no
Fixed ticket? part of #10583
How to test? Not worth testing until summary and products block are done.

This change is Reviewable

@zuk3975 zuk3975 requested a review from PrestaShop/prestashop-core-developers as a code owner Oct 17, 2019
@zuk3975 zuk3975 force-pushed the zuk3975:m/orders/search-cart-rule branch from db3e2c4 to 1b27926 Oct 17, 2019
*/
_search() {
const searchPhrase = this.$searchInput.val();
if (searchPhrase.length < 3) {

This comment has been minimized.

Copy link
@zuk3975

zuk3975 Oct 18, 2019

Author Contributor

@matks, should i also restrict this in php side handler?

This comment has been minimized.

Copy link
@PierreRambaud

PierreRambaud Oct 19, 2019

Contributor

Not necessary, depends if you're sure it's a global behaviour or only for the front.

@zuk3975 zuk3975 changed the title [WIP] BO create order part-3. Implement vouchers search BO create order part-3. Implement vouchers search Oct 18, 2019

$.get(this.router.generate('admin_cart_rules_search'), {
search_phrase: searchPhrase,
}).then((cartRules) => {

This comment has been minimized.

Copy link
@PierreRambaud

PierreRambaud Oct 19, 2019

Contributor

no catch?

This comment has been minimized.

Copy link
@zuk3975

zuk3975 Oct 20, 2019

Author Contributor

is it better to hide it with unexpected error like that f968f69 ?

This comment has been minimized.

Copy link
@PierreRambaud

PierreRambaud Oct 21, 2019

Contributor

yes, otherwise nothing will happened and the user will never understand why 😅

zuk3975 added 2 commits Oct 20, 2019
…alue obtaining from request
@zuk3975 zuk3975 changed the title BO create order part-3. Implement vouchers search BO create order part-3. Implement vouchers managing Oct 21, 2019
@matks matks removed the WIP label Oct 21, 2019
*/
render(cartRules, emptyCart) {
this._hideError();
// do not render cart rules block at all if cart has no products

This comment has been minimized.

Copy link
@matks

matks Oct 21, 2019

Contributor

👍

@@ -24,18 +24,18 @@
*/

import createOrderPageMap from './create-order-map';
import CustomerSearcherComponent from './customer-searcher-component';
import CustomerManager from './customer-manager';

This comment has been minimized.

Copy link
@matks

matks Oct 21, 2019

Contributor

Idea from @PierreRambaud : manage this dependency list using alphabetical order. This helps avoiding git conflicts as when 2 PRs modify this list, they insert new items at different locations instead of always at the end of the list

@@ -39,4 +39,6 @@ export default {
cartDeliveryOptionChanged: 'cartDeliveryOptionChanged',
// when cart free shipping value has been changed
cartFreeShippingSet: 'cartFreeShippingSet',
// when cart rule is removed from cart
cartRuleRemoved: 'cartRuleRemoved',

This comment has been minimized.

Copy link
@matks

matks Oct 21, 2019

Contributor

👍

options:
expose: true

admin_carts_delete_rule:

This comment has been minimized.

Copy link
@matks

matks Oct 21, 2019

Contributor

just got an idea 🤔 shall we put "ajax" in routes handling AJAX requests ?
it's not pretty but this would provide a simple way for module developers to find out which route is an ajax route and which is not

not sure about that ... wdyt @PierreRambaud @jolelievre @matthieu-rolland @Progi1984 ?

@matks
matks approved these changes Oct 21, 2019
@matks matks added this to the 1.7.7.0 milestone Oct 21, 2019
@matks

This comment has been minimized.

Copy link
Contributor

matks commented Oct 21, 2019

Merged in order to ease split working. QA, Product and Wording reviews can happen in the next PR to be built on top of it 😉

@matks matks merged commit 7d5d5ae into PrestaShop:develop Oct 21, 2019
2 checks passed
2 checks passed
PrettyCI Code formatting
Details
Travis CI - Pull Request Build Passed
Details
@matks matks mentioned this pull request Oct 30, 2019
6 of 34 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.