The Promotion Options plugin extends the functionality of the ClassiAds WordPress theme and DirectoryPress plugin by allowing users to add and manage promotion options for listings. It integrates with WooCommerce to handle promotional features in the cart and order details.
GPL-3.0 License
A WordPress plugin designed to add and manage promotion options for listings. This plugin integrates with the ClassiAds theme, DirectoryPress, and WooCommerce to handle various promotional features for listings, including pricing and display on the frontend and in the cart.
The Promotion Options plugin extends the functionality of the ClassiAds WordPress theme and DirectoryPress plugin by allowing users to add and manage promotion options for listings. It integrates with WooCommerce to handle promotional features in the cart and order details.
promotion-options
plugin folder to your /wp-content/plugins/
directory.Plugins
, and activate the "Promotion Options" plugin.The plugin uses AJAX to mark a listing as sold:
mark_as_sold
listing_id
, buyer_id
, seller_id
includes/class-sales-manager.php
: Handles sales-related functions.includes/class-promotion-handler.php
: Manages promotion options and pricing.includes/class-cron-jobs.php
: Contains scheduled tasks.includes/custom-post-type.php
: Defines custom post types for promotions.includes/settings-page.php
: Manages plugin settings.includes/helper-functions.php
: Provides utility functions.includes/locations-ajax.php
: Handles AJAX requests for location-based features.css/promotion-options.css
: Plugin styles.js/promotion-options.js
: JavaScript for handling AJAX and frontend interactions./**
* Mark a listing as sold and record the sale in the database
*
* @param int $listing_id The ID of the listing
* @param int $buyer_id The ID of the buyer
* @param int $seller_id The ID of the seller
*/
public function mark_listing_as_sold($listing_id, $buyer_id, $seller_id)
{
global $wpdb;
$table_name = $wpdb->prefix . 'listing_sales';
$data = array(
'listing_id' => $listing_id,
'buyer_id' => $buyer_id,
'seller_id' => $seller_id,
'sale_date' => current_time('mysql')
);
return $wpdb->insert($table_name, $data);
}
This plugin is licensed under the GPLv2 or later license.
Robert June - Lead Developer @ Lance Desk
For support, please contact [email protected] or open an issue on GitHub.