=== Hamrah – Product Suggestions & Gift Boxes ===
Contributors: mrhamidreza
Tags: woocommerce, upsell, frequently bought together, gift box, bundle
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Suggest companion products customers can pick one by one or sell them as a set, with per-item discounts, plus gift boxes matched by size or category.

== Description ==

Hamrah adds a "complete your order" block to the WooCommerce product page.

**Suggestions you control per product**

* Pick any simple product or single variation as a suggestion, with its own quantity and an optional percent or fixed discount.
* Choose how they are sold: **optional** (the customer ticks only the items they want) or **required set** (everything is added together).
* Pre-select items you recommend most.
* A running total shows the product plus the selected items before adding to cart.

**Correct cart, every time**

* Each suggestion is added as its own cart line, so prices, stock, coupons and shipping rules keep working normally.
* Discounts apply only while the main product is in the cart.
* Items of a required set follow the main product's quantity and are removed together with it.

**Gift boxes**

* Mark any product as a gift box and enter its inner size.
* Boxes are offered when the product fits inside (any orientation, with a packing margin you set), when the box is assigned to the product's category, or when you choose boxes on the product.
* The customer can add a gift message and ask for no prices in the package. Both show in the cart, the order, the emails and as an order note.

Hamrah has no external services, no tracking and no upsell screens. It works with HPOS and the cart and checkout blocks.

== Installation ==

1. Upload the plugin and activate it. WooCommerce must be active.
2. Go to WooCommerce → Settings → Products → Suggestions & gift boxes to set the defaults and turn on gift boxes.
3. Edit a product and open the "Suggestions" tab to add suggested products.
4. To offer gift boxes, tick "Gift box" in the Shipping tab of the box product, then assign boxes to categories or enter product dimensions.

== Frequently Asked Questions ==

= Can a variable product be suggested? =

Suggest a specific variation. A variable product itself cannot be added without a choice of options.

= What happens if the customer removes the main product? =

Items of a required set and gift boxes are removed with it. Optional items stay in the cart at their normal price.

= What if an item of a required set is out of stock? =

The set cannot be added to the cart and the product page explains why.

= Does it work with page caching? =

Yes. The block contains no user-specific data and needs no session-bound tokens.

== Screenshots ==

1. Suggestions and gift box on the product page.
2. The Suggestions tab in the product editor.

== Changelog ==

= 1.0.3 =
* Fix: the running total now works in block themes (prices, currency and variations).
* The gift message box uses the theme font.

= 1.0.2 =
* Product page: keep the layout fix working in themes that force the add to cart form onto one row.

= 1.0.1 =
* Product page: the block takes its own row in themes that lay out the add to cart form as a single row.

= 1.0.0 =
* First release.
