I have PHP 5.6.0 and MySql 5.5.54.
I believe we have COWOA installed on this store and the Categories Center Box Mod by Numinex
But we have taken our main site and made clones of it for our customers as we are wholesalers and want to offer our clients a way to have an online catalog of our products.
So while this is 151 its been HEAVILY modified to have this functionality. Unfortunately I did not do the modifications, the guy who did them didn't document, and I have 7 months experience with Web Design. (I've been working for this company for 7 months.)
One of the functionalities my boss wants for these sites is to allow our customers to select which categories they want to show on their site. So what I want to do is strip most of the functionality of the admin categories page to just allow them to turn off/on the categories. Nothing Else. I don't need it to go to the other page and warn them that is will turn off all the products also.
So my thought was to change this in the categories_product_listing.php module:
PHP Code:
<?php
if ($categories->fields['categories_status'] == '1') {
echo zen_draw_form('setflag_categories', FILENAME_CATEGORIES, 'action=setflag&cID=' . $categories>fields['categories_id'] . '&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . ((isset($_GET['search']) && !empty($_GET['search'])) ? '&search=' . $_GET['search'] : ''));?>
<input type="image" src="<?php echo DIR_WS_IMAGES ?>icon_green_on.gif" title="<?php echo IMAGE_ICON_STATUS_ON; ?>" />
<input type="hidden" name="flag" value="0" />
</form>
<?php
}else {
echo zen_draw_form('setflag_categories', FILENAME_CATEGORIES, 'action=setflag&cID=' . $categories>fields['categories_id'] . '&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . ((isset($_GET['search']) && !empty($_GET['search'])) ? '&search=' . $_GET['search'] : ''));?>
<input type="image" src="<?php echo DIR_WS_IMAGES ?>icon_red_on.gif" title="<?php echo IMAGE_ICON_STATUS_OFF; ?>" />
<input type="hidden" name="flag" value="0" />
</form>
}
Which I believe will mimic what happens when a single product is turned on/off. That is this code.
PHP Code:
<?php
if ($products->fields['products_status'] == '1') {
echo zen_draw_form('setflag_products', FILENAME_CATEGORIES, 'action=setflag&pID=' . $products->fields['products_id'] . '&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . ((isset($_GET['search']) && !empty($_GET['search'])) ? '&search=' . $_GET['search'] : ''));?>
<input type="image" src="<?php echo DIR_WS_IMAGES ?>icon_green_on.gif" title="<?php echo IMAGE_ICON_STATUS_ON; ?>" />
<input type="hidden" name="flag" value="0" />
</form>
<?php
} else {
echo zen_draw_form('setflag_products', FILENAME_CATEGORIES, 'action=setflag&pID=' . $products->fields['products_id'] . '&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . ((isset($_GET['search']) && !empty($_GET['search'])) ? '&search=' . $_GET['search'] : ''));?>
<input type="image" src="<?php echo DIR_WS_IMAGES ?>icon_red_on.gif" title="<?php echo IMAGE_ICON_STATUS_OFF; ?>"/>
<input type="hidden" name="flag" value="1" />
</form>
Here is the original code from categories_products_listing:
PHP Code:
?php
if ($categories->fields['categories_status'] == '1') {
echo '<a href="' . zen_href_link(FILENAME_CATEGORIES, 'action=setflag_categories&flag=0&cID=' . $categories->fields['categories_id'] . '&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . ((isset($_GET['search']) && !empty($_GET['search'])) ? '&search=' . $_GET['search'] : '')) . '">' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '</a>';
} else {
echo '<a href="' . zen_href_link(FILENAME_CATEGORIES, 'action=setflag_categories&flag=1&cID=' . $categories->fields['categories_id'] . '&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . ((isset($_GET['search']) && !empty($_GET['search'])) ? '&search=' . $_GET['search'] : '')) . '">' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . '</a>';
}
if (zen_get_products_to_categories($categories->fields['categories_id'], true, 'products_active') == 'true') {
echo ' ' . zen_image(DIR_WS_IMAGES . 'icon_yellow_on.gif', IMAGE_ICON_LINKED);
}
?>
So can y'all look it over and see if what I did wrong because right now the categories.php is only loading the legend.
Oh yeah I have looked at my Logs and nothing has been added.
Thank you so much for all the help! I've scoured this site many a times looking for answers and plugins.
This is our main site:
Wholesale Store
This is one of our clone sites:
Cloned Store (my test one)
I'm sure it's something easy stupid that I missed since I've been working on this since 6:30 am
Bookmarks