blockonomics / prestashop-plugin

Accept bitcoins on your website, payments go directly into your wallet
Other
16 stars 22 forks source link

Remove angularJS dependency in prestashop and use same standalone PHP component #149

Open blockonomics opened 2 years ago

blockonomics commented 2 years ago

Copy https://github.com/blockonomics/woocommerce-plugin/pull/276

Few things to think about:

anktd commented 2 years ago

Alright.

anktd commented 2 years ago

Removing AngularJS and using the checkout.js from https://github.com/blockonomics/woocommerce-plugin/pull/276 @DarrenWestwood @thisisayush There are some minor things we need to look at:

Do we add these component since we want our checkout.js to be uniform across platform? Or we simply comment these in javascript for now, since we are looking to properly handle errors anyway - https://github.com/blockonomics/woocommerce-plugin/issues/279

DarrenWestwood commented 2 years ago

HTML structure of checkout page is similar except 2 extra divs

Both of these can be included in the Prestashop module as these form part of the checkout and should only affect the frontend.

In PS, we are passing $crypto['code'] as caps in payment.tpl

Is there a reason we are using caps in Prestashop? We should try resolve this in PS rather than changing the checkout JS.

Lastly, the finish_order_url is named $redirect_link

Using data-finish_order_url="{$redirect_link|escape:'htmlall':'UTF-8'}" is correct for simple integration. We can rename to finish_order_url to match woocommerce in a separate PR to avoid unnecessary overhead to the PR.

Let's not make changes until the woocommerce release has been finalized.

DarrenWestwood commented 2 years ago

Copying complete code from wordpress into prestashop nullifies the meaning of a component.

We can create a separate github repository to contain the checkout php, js, and css. Some limitations include:

anktd commented 2 years ago

In PS, we are passing $crypto['code'] as caps in payment.tpl

Is there a reason we are using caps in Prestashop?

Yes, we are doing it to display the $crypto['code'] in checkout page as shown below

crypto_code

So, we can just remove these lines so that it isn't passed in caps to payment.tpl and in our smarty template, just do <li>{$crypto.code|upper|escape:'htmlall':'UTF-8'}</li>