Get all products from subcategory in bigcommerce - bigcommerce

So I'm customizing a bigcommerce website and we've got a design that calls for a category page being broken up into it's subcategories. So for instance:
Parent Category
Sub Category
product product product product product product product product product product product product product product
Sub Category
product product product product product product product product product product product product product product
Unfortunately the bigcommerce subcategory object is currently very limited. In the docs it says:
subcategories - List of any child categories id - Unique ID for the
subcategory
name - Name of the subcategory
url- URL to the subcategory
description - Merchant-defined description of the
subcategory
image - Image representing this subcategory, in Stencil
image format
product_count - Number of products in the subcategory.
(Counts at the current level only – not recursive to deeper levels.)
So My question is if somebody has found a clever way around this to get the subcategory products.

Related

Avoid Listing Sale Orders based on Products

My Requirement is not to show the Sales Orders whose Product Code in the list.
Issue is, as Sales Orders contain multiple Products, my domain filter is going wrong.
Filter Domain i wrote is,
[['state', '!=', 'done'], ['product_id.default_code', 'not in', ['12345', '12311','45345']]]
Sale Orders only with one product and whose Product Code in the list, are getting filtered.
But, Sale Orders with multiple Products and in which one product's default code is in the specified list are also listing.
How to avoid this
You should create one related field store False in sale order line.
Ex:
class sale_order_line(models.Model):
_inherit="sale.order.line"
default_code=fields.Char("default code",related="product_id.default_code",store=False,readonly=True)
Now you can give Domain based on sale order line.
[['state', '!=', 'done'], ['order_line.default_code', 'not in', ['12345', '12311','45345']]]

Prestashop 1.6.1.4 not stacking discounts and showing wrong price

I have a problem with my Prestashop: If a product only have quantity discounts the total price shown in the cart is correct, but when I also apply a category general discount (from Price Rules) that involves a product that also had a quantity discount, the last one overrides the category discount.
In the product template (product.tpl) price is correct (I mean, both discounts are applied, firstly the category discount and then the quantity discount) but in the shopping cart only quantity discount is applied.
Is there a way to achieve stacking of these discounts?
Thank you in advanced!

How to SELECT data from a table that displays a new column as a percent increase in data from an old column?

I am learning SQL and I've been stumped on this question from my book for awhile now.
The questions in this book are asked in a way that I am the DBA for a book store.
So, I have all these tables (Books, Author, Publisher, Customer, Order, etc.) I assume were created by the author of this book (Oracle 11g by Joan Casteel).
This question asks me:
Management is proposing to increase the price of each book. The amount of the increase will be based on each book’s category, according to the following scale: Computer books, 10%,Fitness books, 15%, Self-Help books, 25%, all other categories, 3%. Create a list that displays each book’s title, category, current retail price, and revised retail price. The prices should be displayed with two decimal places. The column headings for the output should be as follows: Title, Category, Current Price, and Revised Price. Sort the results by category. If there’s more than one book in a category, a secondary sort should be performed on the book’s title.
Create a document to show management the SELECT statement used to generate the results and the results of the statement.
So I know in my SQL statement I need to SELECT the title of these books, category of the books, current retail price of the books, and a revised retail price of the books. For this revised retail price, I need to display a % increase of the old retail price, and do this by category.
This is what I have started doing:
SELECT title, category, retail AS "Current Price", retail + (10/100) AS "New Price"
FROM books
WHERE category = 'COMPUTER';
When I do this though, I only get results from the COMPUTER category of books and I need results from all categories and display the % increase in price by category.
How do I do it so that I can create that next column as "New Price" and display ALL of the books with their specific % increase in retail price according to the category of book?
You could use a CASE statement to do this.
SELECT title, category, retail AS "Current Price", retail * CASE category WHEN 'COMPUTER' THEN 1.1 WHEN 'FITNESS' THEN 1.15 ELSE 1.03 END AS "New Price"
FROM books
I didn't fill in all the categories and you'll want to check to make sure you know exactly how they are formatted in your field.
Do this:
SELECT title, category, retail AS "Current Price", retail + (10/100) AS "Revised Price"
FROM books
WHERE category IN ('COMPUTER', 'FITNESS', 'SELF HELP');

how to set discount price for multiple products in prestashop

I am using prestashop version 1.5.4.1
I am need to set clearance sale offer to my shopping site (particular date).
In particular date i need to set discount price for all products in my products by common.
EXAMPLE : I have 250 products in my catalog. I need to discount price $100 for all products from june-24 to june 30. How to set in a one click
You can easily set a "Catalog price rule" in your PrestaShop Back-office.
Go to "Price rules > Catalog price rule" and create a new rule.
It will allow you to select various criteria and the amount or percentage of reduction you would like to apply to all the related products.
You can also cumulate the criteria, example:
For all products in the "T-shirts" category
With "XXXXX" as a Manufacturer
and with the color "Blue"
=> Apply a discount of 30%
Regards,

Product magento discount in Magento table - sales_flat_order_item

If I apply a discount on a product in Magento and make an order...
example: SKU 9999999 Regular $100, Special this week: $95
If I do a query on files sales_flat_order_item and sales_flat_order, where would I find the regular price?
I don't see why you'd need to do this in SQL, but you could look up the product id/sku in the flat products table (I forget its name off the top of my head), and then find the regular price in there.