I have a product list and a shopping cart.
I add the products to the cart.
As the first item in the list of products added to the cart I want to view the last product I added.
How can I view the list of products added according to this order?
Related
To simply explain, I have a model product with columns:
(Product model):
name
type
(Order model):
order
price
quantity
I am using the django built-in Paginator and the django-filter.
The paginator works so well and it really filters the items but the problem is, when the paginator is involved, the "Next" or "Previous" button I created will not work well to see the filtered items on the next or previous page because it reloads the whole template and the filter form will be erased.
Example:
I have mouse and keyboard as "choices" on the "Type" column of the product. I have 25 mice, and the paginator divides it by 10. I can filter the items and shows 3 pages for the mice but when I turn to the next page, the keyboard items will show because the filter form is reset. Any help or suggestion will be appreciated. I need to hear any thoughts for this.
I've moved the place input quantity in opencart 2.3 and now it does not make the right quantities count in the cart
product page quantity
cart quantity
Please help me to display the coupon code or coupon name in opencart 2.1.0.1 product page. For the promotion of products I need to display the coupons or promo code in the product page of opencart 2.1.0.1.
I think this will be hard coded, you will have to add a method to the copoun model which will take the product_id and return the copouns related to this product_id, then in the product controller you will need to call this method and list the copouns in a data variable, then in the product view you need to show them in the desired place.
I have an OpenCart site and would like to disable the update button in the View Cart page for products belonging to a specific category. If the products don't belong to the category, the update button will be enabled.
You can add a column in the database then add supporting code to the admin/controller, admin/template, catalog/controller, catalog/view/theme/yourtemplate. Then you can wrap the view cart button in your catalog/view/theme/yourtemplate/product/product.tpl with a PHP IF exists statement.
Just an example. Good luck!
I have a design with twitter bootstrap front-end and django backend, and I want to make on a shopcart a "plus/minus" button to update quantity and price. How would be the best option to do this?
Currently I am using a form with 2 buttons and updating the quantity and price values within the view. If I use Jscript how can I update the session fields quantiy and price ?
I want to achieve this : http://bootsnipp.com/snippets/featured/buttons-minus-and-plus-in-input but when clicking plus/minus to have price updated according to the quantity values.
Javascript can be used to update the price based on the quantity.
Django only does updates when you submit data to the database. You can make a shopping cart object in the database of coarse and save what the User has selected in that cart. But for updates on the page for the price and quantity without submitting data to the database it would be Javascript.
I recommend using Javascript on the page for price and quantity updates, and then when they select an "add-to-cart" button, then to submit the data like any other Django Form, and save the data in a shopping cart for that User's session.
I think for your situation a simple jquery function for when quantity element is changed will suffice.
for example something like
$(document).ready(function() {
$("#quantity").change(function(){
q = document.getElementById("quantity").val()
p = document.getElementById("price").val()
t = p*q
document.getElementById("total").val(t)
});
});