Which hook trigger when address is added or updated from the shop back-end in Prestashop 1.7 - prestashop

When hook is triggered when adding/updating the address from the back-end.

There are several native hooks related to addresses,
use those if you want to interact with the Address object
right before/after it is written onto DB :
actionObjectAddressAddAfter,
actionObjectAddressUpdateAfter,
actionObjectAddressDeleteAfter
And/or you can use
actionValidateCustomerAddressForm
to perform additional validation on the address form
before it's being submitted.

Related

Cancel fetch in react admin

We are using React-Admin v4, and some of our APIs are quite slow. We're using the search input field, and our problem is that api requests can overlap. If there is an existing fetch in progress, typing again doesn't cancel the existing fetch. It fires another one, and the results list is updated when each request returns, leading to confusing UI.
Can we configure the search field to cancel existing fetches when a new one is triggered?
React-admin doesn't implement Query Cancellation, although its underlying data fetching library, react-query, does allow it (see https://react-query-v3.tanstack.com/guides/query-cancellation for details).
So if you want to implement query cancellation in a react-admin filter, you'll have to build your own component based on react-query's useQuery hook, and populate a ListContext with the results. Check the Building a List View By Hand tutorial for guidance.

Spartacus perform search without updating the products in product list page

We have a custom filter functionality which involves adding filters in bulk and applying them at the end. For this, every time a user clicks a breadcrumb, a search call will be performed to update the current list of facets but without updating the product list on PLP. The PLP will be updated only when the user clicks ‘apply’.
The search call needed to update the facet list is done at the moment trough a http call to the search endpoint but is there a better way to do this to benefit more of spartacus (in terms of caching for example)?
Should all the layers of the backend communication be extended for this?
The current spartacus version is 3.3

How to update multiple entities in Cuba Platform Frontend UI

I have a function that returns data from many entities and puts them in a table. When the table is changed and the save button is clicked I need to send all the data to their entities. Is there a way to do this in one action?
If you mean that you need a REST API method which can update several entities at once - then there is no such built-in method in the CUBA REST addon.
However, backend developers can create and expose a "service method" for you that accepts list of entities or POJOs as parameter. Then you will be able to call it from the web page.
See https://doc.cuba-platform.com/restapi-7.2/#rest_api_v2_ex_service_post

BigCommerce - Custom Checkout (Adding Field to Cart)

I am doing some work for a client who uses BigCommerce Stencil Theme and I am pretty new to BC. Until now most of my work with them has been basic theme formatting and styling.
They are asking if I can add checkboxes next to items in cart to indicate an alternative delivery system, and then add a field to address for a hotel room. It seems like built into BC checkout customization you can add fields to addresses so that doesn't seem like an issue, but I'm not so sure about the checkboxes. I would imagine I would need access to the underlying PHP to make this happen which doesn't seem possible. Is this accurate? If not, how might I go about doing this?
I see that I can add the checkboxes themselves to the template files, but as far as sending any data with the checkout I don't know how I'd go about doing this.
For the hotel room address field, you are correct that the simplest solution would be to use the built-in custom address field feature.
For the checkbox/alternate delivery system, we're close to releasing a new Checkout JS SDK that will give you the ability to create a completely custom checkout experience. The SDK is basically a Javascript wrapper for our Storefront Checkout API and it includes operations for checkout actions (like creating a new shipping consignment for an alternate delivery method).
The Checkout SDK doesn't give you access to the underlying PHP; instead, it allows you to create your own frontend using React or whatever framework you prefer. The logic for custom checkout steps would exist in your frontend, and you would send your data to the checkout via the BC Checkout API.
https://stencil.bigcommerce.com/docs/customizing-checkout

How to add homepage URL to SAP business partner?

I'm working on a program witch creates Business Partners in SAP IS-U system. For the creation of business partners I use function module BAPI_ISUPARTNER_CREATEFROMDATA
I have to add homepage URL too, any idea how to do it?
Thanks!
The homepage URL is part of the business partner's communication data, which can either be part of the address data or address-independent communication.
Look at function modules BAPI_BUPA_ADDRESS_ADD/BAPI_BUPA_ADDRESS_CHANGE for updating it with address data (table parameter BAPIADURI) or function modules BAPI_BUPA_CREATE_FROM_DATA/BAPI_BUPA_CENTRAL_CHANGE for address-independent communication, table parameter URIADDRESSDATANONADDRESS.
Unfortunately I do not have access to function BAPI_ISUPARTNER_CREATEFROMDATA to see if it has similar parameters.
Whether or not it must be stored as address-dependent or independent data is a business decision.
As an alternative, you should see whether you can update/create BPs via the BOL.