-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef856c6
commit c7b4c71
Showing
6 changed files
with
105 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
echo $HTML->title_panel([ | ||
'heading' => $Lang->get('Republishing Products'), | ||
], $CurrentUser); | ||
|
||
include(__DIR__.'/list.smartbar.php'); | ||
|
||
|
||
echo $Form->form_start(); | ||
echo $HTML->info_block('Republish Products?', $Lang->get('Are you sure you wish to republish all Products?')); | ||
echo $HTML->submit_bar([ | ||
'button' => $Form->submit('btnsubmit', 'Republish', 'button'), | ||
'cancel_link' => '/core/apps/content/' | ||
]); | ||
echo $Form->form_end(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
$ShopAPI = new PerchAPI(1, 'perch_shop'); | ||
$ProductsAPI = new PerchAPI(1, 'perch_shop_products'); | ||
$Products = new PerchShop_Products($ShopAPI); | ||
$Template = $ShopAPI->get('Template'); | ||
$Template->set('shop/products/product.html', 'shop'); | ||
|
||
$smartbar_selection = 'republish'; | ||
$sort_id = 'productOrder'; | ||
$sort_order = 'ASC'; | ||
$listing_opts = ['return-objects' => true,]; | ||
|
||
$where_callback = function (PerchQuery $Query) { | ||
$Query->where[] = 'productDeleted IS NULL'; | ||
$Query->where[] = 'parentID IS NULL'; | ||
return $Query; | ||
}; | ||
|
||
|
||
|
||
|
||
$Form = $API->get('Form'); | ||
if ($Form->submitted()) { | ||
$products = $Products->get_filtered_listing($listing_opts, $where_callback, true); | ||
|
||
if (PerchUtil::count($products)) { | ||
foreach($products as $Product) { | ||
if (is_object($Product)) $Product->index($Template); | ||
} | ||
|
||
$Alert->set('success', $Lang->get('Products successfully republished. Return to %s Product List %s', '<a href="'. $API->app_path() .'">', '</a>')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
# includes | ||
include('../../../../core/inc/api.php'); | ||
|
||
$API = new PerchAPI(1.0, 'pipit_catalog'); | ||
$Lang = $API->get('Lang'); | ||
$HTML = $API->get('HTML'); | ||
$Paging = $API->get('Paging'); | ||
|
||
# Set the page title | ||
$Perch->page_title = $Lang->get('Products: Republish Products'); | ||
|
||
# Do anything you want to do before output is started | ||
include('../modes/_subnav.php'); | ||
include('../modes/republish.pre.php'); | ||
$Perch->add_css($API->app_path().'/assets/css/styles.css'); | ||
|
||
# Top layout | ||
include(PERCH_CORE . '/inc/top.php'); | ||
|
||
# Display your page | ||
include('../modes/republish.post.php'); | ||
|
||
|
||
# Bottom layout | ||
include(PERCH_CORE . '/inc/btm.php'); |