Assign Calibers to Products

Set each product's caliber text, drop-down text, and done flag for the selected category.

Script Overview

This screen lists products in the selected category and its child categories. Caliber text and the product drop-down text are stored on the product. The Done checkbox records that the product has been reviewed. The category drop-down title is stored on the category. Add puts a new title on the shared list only. Update saves the title selected in the drop-down for this category, plus the products on the page you are viewing.

Operator Workflow
Step 1
Choose a Category
  • Select the store and category.
  • Choose View. Child categories are included.
Step 2
Set the Menu Title
  • Select a title, then choose Update to save it on this category.
  • Add puts a new title on the shared list. It does not change this category.
Step 3
Edit This Page
  • Enter the caliber text and the product drop-down text.
  • Check Done when that product is finished.
Step 4
Update
  • Update writes the rows on this page and the selected menu title.
  • An unchecked Done box clears Done for that product only.
Step 5
Change Pages
  • Save before using the page arrows. Unsaved rows on this page are not kept.
  • Choose Close to return to the inventory index.
Technical Reference & Safeguards
  • Data Read: oc_product, oc_product_to_category, and oc_product_description with language_id = 1. Menu rows come from pd_category_dropdownmenu and pd_calibers_dropdownmenu_choices.
  • Database Writes: Update sets oc_product.custom_field fields 2 and 6, inserts or deletes pd_caliber_product_done for posted product ids, and sets pd_category_dropdownmenu.defaultmenu. Add inserts pd_calibers_dropdownmenu_choices.value only.
  • Safeguards & Notifications: Product and menu writes share begin_transaction(), commit(), and rollback(). A placeholder menu row is inserted only when the category has zero rows. Done flags are changed only for posted product ids that belong to the selected category. A failed save leaves a danger banner and writes the error to the server log.



Choose a category and select View.