I want to Refresh my store content, I have a to display list of tickets and for each ticket there are list of attachments. Attachments are optional so For a ticket there maynot be an attachment.
I am using Odata proxy based on Rest Proxy.
I have 2 separate store for ticket and attachment. If I load the attachment store based on a ticket which has attachment, the store gets populated, now when I select a ticket which has no attachment the store doesnt get refreshed but is showing me the store content from the previous ticket. If I try to use "RemoveAll" method on the store, the store tries delete the entries in the Backend system which I dont want. I just want the store to refresh its content on each request.
what is the way to reload the store and refresh its content
thanks!
Did you try with:
Ext.getStore('myStore').load();
Related
I am trying to add a small 'lockup' / promo to a page that loads information dynamically based on page.metafield information. Replacing images, video ID's etc. Which all works just fine.
My client is asking for a small area to display a product that relates to this dynamically changing content and I am struggling to come up with a good way to do this.
The current setup is that we have 30 pages with a set of 8 metafields each page. Each one of these pages must show a different , single product with an image, title, price, buy button and another button that links out to a partner site.
I can create snippet and load almost all of this info through metafields manually (price, title etc the client could just add to another metafield) but I would prefer to load a product to pull this info so it can be added to cart. Although I can add product data manually, I still don't actually know which product will get added to the cart, because I'm on a 'page' not a 'product'.
The products themselves are using a custom template that is different to the rest of the site so that seems like its not an option. The template for this content page is just 'page' but surely I can call the product object someway? If the client entered a product ID in the metafields, is there a way of pulling that IDs data easily?
Whatever you mean by pulling ID's, but there are a couple of ways of dealing with this. One, you have a Storefront API token, allowing you to freely and securely call Shopify with JS and get back all the data about the ID you're interested in. Or, you have an App installed in the store, in which case you can setup and callback an App Proxy, providing that ID, and getting back all the info you need. Lots of options!
I manually inserted images into my collection table and into directus_files table with matching uuid and filename.
When I click on an item of my collection I can see the image however the thumbnails are broken:
I can see that if I manually upload an image through directus admin interface two thumbnails are created in the local folder with an uuid and a double underscore and a random hash I cannot figure out how is made.
Is there any way to regenerate the thumbnails?
Ok found out, you basically have to harness the REST API to regenerate the thumbnails otherwise Directus is not "smart" enough to regenerate them when you open an item from the collection or fallback to the original image.
The thumbnail also uses a strange hash in the filename derived from the creation time and user so you won't find the name explicitly in any table of the database.
The REST API has to be called as follows:
http://localhost:8055/assets/c1982e98-5b6d-4327-807a-2561002029d7?access_token=mytoken&width=60&height=60&quality=80
the access token is created from the user administration panel, the guid is the one in the database associated with the image.
Notice the width and height must be specified in the database table associated with the image otherwise the REST API will return a warning.
i have created a form to make a submission to an api using axios.
There are 3 other parameters and then the files to submit.
I got it working with one file but what I need to do is be able to have multiple files uploaded and then submit, i tried using the multiple flag but this seems to only allow you to select multiple files in the same folder at once rather than choosing and selecting the files individually.
I don’t want the files sent to the api until the submit button is clicked though.
I thought maybe about using local storage to put the files and then pull to submit at once when the button is clicked?
You can use Base64 encode in client side and add the encoded string to your post request and decode from server side.
Is it possible to add a input type=file element to the checkout.html and persist it as an attachment to a checkout?
It seems the only way to make a file attachment in an order that would be visible from the store admin is to create a file option https://support.bigcommerce.com/s/article/Options-SKUs-Rules#file-upload, and add that to the cart to support the attachment.
No, at this time it is not possible to add a input type=file element to the checkout.html and persist it as an attachment to a checkout.
Current Options
Apps
https://www.intuitsolutions.net/bigcommerce-add-ons/purchase-order-solution-pdf-upload/
Product Option
File Upload Product Option - https://support.bigcommerce.com/s/article/Options-SKUs-Rules#file-upload
A file can be stored as an option-value on a product that is dynamically added to the cart.
This would require effort in hiding the product that represents the purchase order from showing up in the cart and checkout.
Future Options
file upload field support is coming soon for the S2S Cart API - thanks #KarenWhite
True Purchase Order Support sometime in the future...
I have a ViewModel returning a list of documents and their associated blob storage address. When the user clicks the link I want to be able to open the pdf document in another tab but using the code below I have been unable to do so.
<h4>#document.Name</h4>
I have also tried:
<h4>#document.Name</h4>
No need to include Url.Content for this as it is rendering the blob storage address straight from the database
<h4>#document.Name</h4>