Opencart (Cart page ) Update price when change quantity Automatic - opencart2.x

I am making the Review Cart & Checkout form. If users want to change the quantity I want that if quantity is changed the price of it will be changed automatically.
Please help to adjust the code in the same JS of plus-minus or separate.

In OpenCart cart is updated by submitting data to server and then getting response. This is done because product information is in encrypted form and every time needs to be submitted to server. So only Js in client side is not sufficient. So you can use following points.
`These steps can solve your problem.
Create your JavaScript functions which decreases or increase number in quantity box.
Do not remove your update cart button in original cart page.
Make use of that button to update your cart.

Related

Express Checkout Customization in Hybris

Suppose a user has 2 items in his cart. He goes to another item detail page and clicks buy now. Now, by default, all the two products also add up and go for checkout. My requirement is that when the user clicks buy now, then only that product should proceed and not merge with the other two items in the cart. If the user does not complete the order placement procedure, then it should be added to the cart with the other 2 items. But if he completes the order placement procedure, the other 2 items should stay in the cart.
This is what Flipkart does. Any suggestions in how to achieve this?
Usually, such tasks require a big amount of analytics to find all cases. But a simple plan is:
Create a new button for "Buy now" that will call your own controller/facade/service instead of de.hybris.platform.commerceservices.order.impl.DefaultCommerceCartService#addToCart
Add a new boolean property buyNow to the CartModel
Your new service needs to clean the session from the previous cart. Create a new one with cart.buyNow = true
redirect your customer directly to the checkout
If a customer leaves the checkout or successfully places an order. Clean up all his carts with the buyNow flag. And run a cart restoration process that will return his original cart.

How to protect hidden input to be changed by the user

I'm developing an online store website which has several products and user can submit comment for each single product.
So when the user opens a product webpage, they can submit their comments via comment form. In order to do that I've put a hidden input in the comment form which holds the id of the product however, it can be easily manipulated.
I've search a lot and I know that you can never trust data sent by the clients but I suppose there must be a way to make sure that the comment sent is exactly for the product the user is seeing right now. Because user can see a product on the website and change the product id in the hidden input of the comment form and submit it to the server.
Please help.
Thanks in advance.

Customise Netsuite Site Builder Cart

So I've been tasked with getting a custom item field value displayed on an item in the cart of a site-builder site.
I have experience with SCA but not so much when it comes to site builder. I can see how templates are put together and how to display data in these templates.
I can also tell that it is possible to add or remove field sets from the cart in the 'Set Up Website' tab.
Another thing to note is that the Live Hosting Files are empty.. which is where I would have expected to find the scripts that would create the cart.
So my question is, how do I either create a new row in the 'Set Up Website => Cart' tab to display this new custom field. Or where can I find and edit the template/script that creates the cart?
Any help is appreciated!
Is this the old SiteBuilder Cart or from the new SiteBuilder Extensions? If so, which version? The old, original SiteBuilder Cart is really difficult to add customizations such as a custom field. I would do it by running an AJAX call on a SuiteScript to get the needed data that write it into the cart cell. It was a hack but at least I was able to customize it.
The SB Extensions work a lot like SCA, and it what to do depends upon the version. If it is only for the cart, then just extend Item Keys Mapping and then it will be available on the template file. If you also need it on the cart summary in the checkout then, see SuiteAnswers for the specifics for the various versions.

Hybris product configuration

I'm having a problem with the product list configuration of hybris. I'm more than sure that the answer of this issue is pretty simple, but I can't solve it. So here is the problem.
I have one homepage with one link, assigned to the navigation bar. Whenever the link is pressed I want to get redirected to a product list page where a list of all products of certain category will be displayed. However, I managed to do this, but anytime I change the name of a certain product something happens and the page stops displaying. It throws an error saying it is looking for the old name of the product I've edited.
For example, if the product name is Product1, the page is displayed, then I go and change the name to Product2 and when I press on the link, it throws an error Product with code 'Product1' not found! If I want this to be fixed, I have to create a new Product1 and I'm more than sure that this is not the right way it should work. Is there any synchronization that I need to do after making changes in the catalog or something of this kind? Any help will be appreciated!
I recommend you try two things that may resolve your issue.
When you make a change to a product, you will more than likely do it to the staged catalog. This is your intermediary to ensure information is correct before going live (especially useful if you have a workflow process in place). In order to synchronise this information, you will need to login to the product cockpit (your-server:9000/productcockpit). Find the staged version of the catalog on the left hand menu, right click on it, and select "Sync Selected Versions". This will transfer your information into the Online catalog.
When you arrive on the product listings page and the search results page, the information contained is more than likely indexed by SOLR. In order for any changes to be reflected, you will need to re-index. To do this:
Go to the HMC and login (your-server:9000/hmc/hybris)
In the navigation menu to the left, click on System > Facet Search > Indexer Operation Wizard
A pop-up window will appear. Select the Indexer operation as update and the Solr configuration to the index associated with your website.
Click start and the re-indexing will begin. It shouldn't take too long
If this fails, then you may need a full re-index instead
I hope this will help; I recommend you set up a Cronjob to re-index periodically in future, to keep your website up to date with your product management.
PLP(Product Listing Page) fetches data from Solr. So whenever you are changing anything that is referred in the PLP, you need to update your indexes in Solr.
As you have changed the product name, update the Solr index from hmc.

Drupal: How to add a form and perform functionality on it

I am new to Drupal and trying to get hand on it.
I am not able to find how to have the following functionality on my site. If anyone can help me out, it would be great for me.
I need to have a form that will take 2 fields one of which is supposed to be the login id(how to retrive login id?). I need to store this and display in tabular form also on a new page. Lastly I want to provide an edit form for this functionality using the same form but its use will be like whenever a person adds value in this form, it checks in Table1, if entry is not present it adds in table, else it updates the table.
Apart from this I need to store all the updations in a seperate table or something like that, so that I am able to see the history of all the changes
Eg:
ADD Form:
Fields:
- LoginID
- Phone number
Show Table Page(Tabular with the stored information)
Edit Form(same as above form):
Fields:
- LoginID
- Phone number
Now If I add my phone number to this it will get stored. Later when I try to modify my number it should update in initial table but also store the history of old and new entry in a separate table so that I can perform varies options on it.
I also dont know how to add/enable form fields in drupal. :(
Thanks
I'm not entirely sure what you're asking, but I think the Computed Field module might be helpful. The module allows you to define custom hooks that run when a node is saved.
If you're not creating nodes and are using something like the Webform module, you should be able to write a module to process the data.

Resources