News:

AbanteCart v1.4.2.1 is released.

Main Menu
support

Which table has products for block

Started by Sam_78, May 08, 2017, 04:15:53 PM

Previous topic - Next topic

Sam_78

I am looking into Database and trying to find out which table contains the product_id to be displayed in block
Example: Featured block has 7 products so which table have this information???.. products_featured has them but I have created custom listing block and looking for their DB

I am trying to find products only if its in any block.. is there a query which I can run to find only those products who are in any of the block..
I have so many blocks so it is confusing to maintain inventory and lots of duplicate

abolabo

Hello.
For listing blocks just look into table block_descriptions for custom block contents.
If block is generic try to find controller for it, such as block/featured.php (also you can use template debug setting (system->settings->system) to define it)

Sam_78

Thanks abolabo,
But I have many products that are not assigned in any block and are still ON(old products). Is there any easier way(query) I can run to find list of products whose status is ON and are in any block. So that I can look at them individually and turn them OFF.

teelatrmo

The template debug setting (system->settings->system) can be used to define the controller to utilize if the block is generic, like block/featured.php.

abigailkent1122

Not necessary to have product_id in blocks, just copy from database and paste it over your backend.

Sterlingg

Quote from: teelatrmo on March 24, 2023, 04:08:35 AMThe template debug setting (system->settings->system) can be used to define the controller to utilize if the block is generic, like block/featured.php.
Could you provide more specific step

sanjay210

To find which products are shown in blocks, it depends on how your system handles them. For standard blocks like "Featured," the products_featured table stores product IDs. For custom blocks, check if there's a table like custom_block_products or products_to_blocks. If you're looking to get all products that appear in any block, you can use a SQL query with UNION across all block-related tables. For example, pull product IDs from products_featured, specials, and your custom block tables. If managing many blocks is getting confusing, consider using a single relational table to track which product is in which block.

Forum Rules Code of conduct
AbanteCart.com 2010 -