Jump to content



wHiTeHaT

Member Since 01 Nov 2002
OFFLINE Last Active Today, 17:56
*****

Topics I've Started

The last straw (2.4 beta) Language system GIT

03 November 2016 - 08:29

  1. Documentation for v2.3.x Braintree App
  2. v2.3.x Braintree App tagged on Github
  3. Documentation for v2.4 Braintree App
  4. v2.4 Braintree App tagged on Github
  5. Documentation for v2.3.x PayPal App
  6. v2.3.x PayPal App tagged on Github
  7. Documentation for v2.4 PayPal App
  8. v2.4 PayPal App tagged on Github
  9. v2.4 OSCOM Framework Documentation
  10. Review and consider language definitions updates for inclusion in v2.4.0beta or to leave for v2.4.1beta
  11. v2.3.5 Package for testing
  12. v2.4.0beta Package for testing
  13. Release + Release Announcement

 

 

Review and consider language definitions updates for inclusion in v2.4.0beta or to leave for v2.4.1beta

 

This task is almost completed, the sooner it finished the easier is to merge it with the master.

Current language system is up to date with current oscommerce2 master.

 

So let's make the last changes together as it isn't rocket science almost anyone can do it.

 

You can find the osCommerce_Language_System branch right HERE

 

 

Thanks!


Oscommerce Actions handled by Hooks

12 October 2016 - 07:44

Just did some testings related on the following post by @burt :

 

http://forums.oscomm...erce/?p=1748128

 

As @kymation mentioned the hooks class for running site actions (form submits or general CRUD actions), i took the challange for testing the idea.

 

I can tell you it works.

I will later post the files here for testing and refine the code after "we" inspected and verify the code.

 

A simple example code to give you an idea:

 

application_top (removed the switch/actions code and replaced with 1 line only) :  

Registry::get('Hooks')->call('Actions', $_GET['action']);

The hook code for add_product:

namespace OSC\OM\Module\Hooks\Shop\Actions;
use OSC\OM\OSCOM;
class add_product
{
    public function execute() {
  global $messageStack;
 
  if ( DISPLAY_CART == 'true' ) {
   $goto =  'shopping_cart.php';
   $parameters = array('action', 'cPath', 'products_id', 'pid');
  } else {
   $goto = $PHP_SELF;
   if ( $_GET['action'] == 'buy_now') {
    $parameters = array('action', 'pid', 'products_id');
   } else {
    $parameters = array('action', 'pid');
   }
  } 
  if (isset($_POST['products_id']) && is_numeric($_POST['products_id'])) {
   $attributes = isset($_POST['id']) ? $_POST['id'] : '';
   $_SESSION['cart']->add_cart($_POST['products_id'], $_SESSION['cart']->get_quantity(tep_get_uprid($_POST['products_id'], $attributes))+1, $attributes);
   $messageStack->add_session('product_action', sprintf(PRODUCT_ADDED, tep_get_products_name((int)$_POST['products_id'])), 'success');
  }
 
  OSCOM::redirect($goto, tep_get_all_get_params($parameters));
}
}