Commercetools cart lineitem inventory update - spring-boot

I am trying to read inventory from the lineitems in cart, but inventory is not updated at lineitem. Is there any way to read updated inventory of lineitem without recalucate cart action?

As stated in our documentation the availability field on line item variant of a cart might not contain the latest inventory state:
"The availability is set if the variant is tracked by the inventory. The field might not contain the latest inventory state (it is eventually consistent) and can be used as an optimization to reduce calls to the inventory service."
If you want a current number of inventory, please query the inventory endpoint directly.
Also please note that the cart data is stale data and not updated automatically. As you suggested most data is only updated with a recalculate action.

Related

Amazon Seller Inventory File – Where to get main image URLs?

I'm trying to update the inventory with more information on clothing sizes, material composition etc. by uploading the appropriate inventory file. Now, the template table that I got from here has loads and loads of required columns such as country_of_origin and target_gender that I need to fill out, as well as main_image_url. I'm not sure what to enter there, as the existing images are just fine.
After researching (see below), I'd like to know if I need to go through the trouble of somehow downloading and uploading all of the product images just for the sake of the inventory table, or if there is any other way to create an inventory file that will not mess up the product information.
Or am I maybe misguided in the way that I am trying to do the product updates?
Thanks for any help!
My Research
Can I just leave the field blank even though it is a required field?
 
On this Amazon help page, it says to include every piece of information for existing products into the table even it might seem redundant. Whether that is a recommendation or an absolute requirement, I cannot tell.
Is there an efficient way to retrieve all of the main image URLs for existing products?
Apparently, it is not possible to download the main_image_url in a inventory report like I did with most other required product data columns.
As our products are imported to Amazon by a Shopify app, we do not have all of the product images saved on a server by product ID or anything like that.
According to this StackOverflow answer, there are API calls for retrieving product images by ASIN, but those are scaled down, I cannot use those.

Query to find order products for related accounts in Dynamics CRM

On the Accounts form, I want to be able to show all Order Products for that Account and any related Account. My aim is to give the user an easy way to see what has been bought by a customer with several related offices (Accounts).
Any idea how this can be done?
There is a way to do this with a plugin. The general steps would be:
Ensure the view that is used on the order product subgrid on the Account form is not used anywhere else.
Make a unique change to the view columns or filter criteria that will let you distinguish it from other views. For example, you could add a condition of "createdon contains data", which most likely would not be used anywhere else
Create a pre-RetrieveMultiple plugin on Order Product.
In the plugin, get the query from the input parameters and check for the "createdon contains data" condition. If it does not exist, exit the plugin.
If the condition exists, this is the view you want to update. In the query, find the condition that has accountid.
Use the accountid to retrieve related child and parent accounts.
Update the query with a condition checking if accountid is in the list of all the accountids you retrieved.
The query should now return all the relevant order products and display them on the Account form.
This is a rather involved solution with only the high level steps outlined here.
Here is a link that shows an example of modifying a query in a pre-retrievemultple plugin:
https://hachecrm2011.wordpress.com/2013/07/19/filtering-views-by-intercepting-retrieve-multiple-queries-with-a-plugin/

Square Connect API V2: Setting item tax rates?

Does an upsert on an item object set the tax rates on the item? The documentation is confusing and it sounds like it would only add new tax rates and not remove missing ones, but in testing it seems that it does both add and remove. Here is the relevant bit from the docs (https://docs.connect.squareup.com/api/connect/v2#type-catalogitem):
Yes, the UpsertCatalogObject can add and remove tax_ids from a catalog object (whatever you upsert will be saved to the object). The UpdateItemTaxes is used if you don't want to change anything else in the item, so you don't need access to the whole item. With it, you don't need to send the whole object back, just the id and the tax_ids that you wish to enable and disable.

ServiceNow reports to pull data related to changes

How to create a report that give me the list of all the changes and it's associated "Affected CIs". So for e.g. I have a change ticket created in servicenow CHG00001 with following values for Configuration Item and Affected CIs:
Change Number: CHG00001
Configuration Item: Server1
Affected CI:
Apache
JBoss
So when I create a report I need these information including all the affected CIs, but I don't see a way to pull that information.
You want to use the CIs Affected [task_ci] table. This is the table that contains the links between the Change Requests and the Configuration Item.
The Task field in this table contains the reference to the Change Request.
In your report, try something like this
Data: Table => CIs Affected [task_ci]
Type: List
Group by: Task
Selected columns
Task
Configuration Item
Filter
Task.Task type is Change Request
You can expand the Task reference in your selected columns to get more details on your Change Request if needed, or filter them deeper.
If you've filtered the Task type as Change Request, you can select the extended table Change Request and filter it that way
Filter
Task.Task type is Change Request
Task.Change Request.Planned start date at or after Last month
You can use Database Views to create a single table created from multiple tables. Then you can use that table to show the report from.
There is a great video about this here. There is also a possibility to have multiple data sets on the same report.

Magento Price Alerts - Trigger on Tiered Price change

I've never set a store up to use Price Alerts before, and now that I've gone through and gotten it to work, it appears as though the alert is only triggered when a product's 'Price' attribute changes.
This is nice, but what about tiered pricing? Looking through the ProductAlert core module, I am not sure where this attribute is being filtered.
I'm guessing that an additional model, say 'productalert/tierprice' will need to be created, followed by a new method in Observer.php, likely _processTierprice(). Just not sure if this concept is correct... could use a little guidance.
Thanks!
This shouldn't be too difficult; lots of options (it's Magento, after all)!
I'd add new methods to deal with tier price alerts. For products with tier pricing, you'd need to capture the relevant tier data along with the final price (either in a new table or in new columns on the existing product alert table). The alerts are sent out via scheduled job. So, in a nutshell (overrides where necessary):
Alter the product alert schema as necessary, and amend the frontend form fields to suit
In the overridden Mage_ProductAlert_AddController add a tierPriceAction() method to process the alert subscription, or adjust its existing priceAction() to handle the data being posted in / tier condition
Override Mage_ProductAlert_Model_Observer as needed; I'd include a _processesTierPrice method() similar to _processPrice().
Add a resource model method to get the tier-related prices
Add a tier price email block and template (reference Mage_ProductAlert_Block_Email_Abstract)
Profit!
As a reference for your price logic, see Mage_Catalog_Model_Product_Type_Price.

Resources