Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

ship2pay for 2.3.x


BrockleyJohn

Recommended Posts

No existing support thread that I can find...

 

I just uploaded an updated version of this addon:

- php7 compliant

- doesn't use filenames.php

- minimal core changes (one file)

 

Addon is http://addons.oscommerce.com/info/8419

 

Also on github in a branch of Edge at

https://github.com/BrockleyJohn/Responsive-osCommerce/tree/addon_ship2pay

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Link to comment
Share on other sites

  • 1 month later...

Hey there John.

 

Thanks for putting this together. 

I took a quick look a the code and noticed a few php notification that were generated due to not checking if variable isset.  Attached is the modified code for the admin page.ship2pay.php

Edited by marcello
Link to comment
Share on other sites

Thanks Marcello, I'll take a look. I confess I didn't go far into testing the existing code or running with E_STRICT, I just whacked in a set of refinements and tested them!

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Link to comment
Share on other sites

  • 1 year later...

@Omar_one that would be a fatal error at any php level

How have you got two class declarations in the file? That usually occurs with modules when people upload the class file to the language directory, so I'm struggling to guess how you managed it.

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Link to comment
Share on other sites

I have no idea 😳  ..... there is class file in the language directory
If I change the

require('includes/classes/ship2pay.php');

to

require_once('includes/classes/ship2pay.php');

the  warring not show any more for that class it give another warring

 warring PHP Fatal error:  Cannot redeclare class cod in /home/shop/includes/modules/payment/cod.php on line 13


 

Get the latest Responsive osCommerce CE (community edition) here .

Link to comment
Share on other sites

@BrockleyJohn   I found why it give this  warring because  I have  Modules Shopping Cart  installed by @raiwa

so if I uninstall it your module working with any warring..  Do you have idea how to make it working with that module ?

Thank you
Omar

Get the latest Responsive osCommerce CE (community edition) here .

Link to comment
Share on other sites

after changing  this line  in  Modules Shopping Cart  module ...  includes/modules/content/shopping_cart/cm_sc_checkout_alt.php ..

      		include('includes/classes/payment.php');

to

      		include_once('includes/classes/payment.php');

 there is no warring,  I don't know if it is the right fix !!!
Br
Omar

Get the latest Responsive osCommerce CE (community edition) here .

Link to comment
Share on other sites

@Omar_one I can't see any problem with your change, it should be fine

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Link to comment
Share on other sites

@Omar_one, thats ok like John says. I'll apply this to the shopping cart module in the next update. Thank you!

Link to comment
Share on other sites

  • 11 months later...

Up to now there is still no way to extend the payment class to restrict the selection on checkout_payment without modifying core code, so the modification to the constructor of the core class is the simplest way of doing it.

If @raiwa's latest request for a hook in the payment form might be a way in if it gets anywhere.

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Link to comment
Share on other sites

  • 1 year later...

@BrockleyJohn    I installed it and there was errors I fixed all of them except this one on the admin 

Notice: Undefined index: action in C:\xampp\htdocs\test\admin\ship2pay.php on line 108

 and here is the line (on just this line there was 4 errors... fixed  3 of them and still the last one " this line after the editing ")

    if (((empty($_GET['s2p_id'])) || (empty($_GET['s2p_id'] == $s2p['s2p_id']))) && (empty($trInfo)  && (substr($_GET['action'], 0, 3) != 'new'))) {

here is the original line 

    if (((!$_GET['s2p_id']) || (@$_GET['s2p_id'] == $s2p['s2p_id'])) && (!$trInfo) && (substr($_GET['action'], 0, 3) != 'new')) {

 
any idea  how to fix it ?

Br
Omar

Edited by Omar_one

Get the latest Responsive osCommerce CE (community edition) here .

Link to comment
Share on other sites

7 minutes ago, ecartz said:

    if ((empty($_GET['s2p_id']) || ($_GET['s2p_id'] == $s2p['s2p_id'])) && (empty($trInfo)) && (!isset($_GET['action']) || (substr($_GET['action'], 0, 3) != 'new'))) {

 

Thank you @ecartz that fix if but now I get  2 another error 

Notice: Undefined variable: trInfo in C:\xampp\htdocs\test\admin\ship2pay.php on line 112

line 103-117
 

<?php
  $s2p_query_raw = "select s2p_id, shipment, payments_allowed, status from ship2pay";
  $s2p_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $s2p_query_raw, $s2p_query_numrows);
  $s2p_query = tep_db_query($s2p_query_raw);
  while ($s2p = tep_db_fetch_array($s2p_query)) {
	if ((empty($_GET['s2p_id']) || ($_GET['s2p_id'] == $s2p['s2p_id'])) && (empty($trInfo)) && (!isset($_GET['action']) || (substr($_GET['action'], 0, 3) != 'new'))) {
      $trInfo = new objectInfo($s2p);
    }

    if ( (is_object($trInfo)) && ($s2p['s2p_id'] == $trInfo->s2p_id) ) {
      echo '              <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link('ship2pay.php', 'page=' . $_GET['page'] . '&s2p_id=' . $trInfo->s2p_id . '&action=edit') . '\'">' . "\n";
    } else {
      echo '              <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link('ship2pay.php', 'page=' . $_GET['page'] . '&s2p_id=' . $s2p['s2p_id']) . '\'">' . "\n";
    }
?>


and 

Notice: Undefined variable: trInfo in C:\xampp\htdocs\test\admin\ship2pay.php on line 128

and here the lines 121-129
 

                <?php
                      if ($s2p['status'] == '1') {
                        echo tep_image('images/icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '&nbsp;&nbsp;<a href="' . tep_href_link('ship2pay.php', 'page=' . $_GET['page'] . '&s2p_id=' . $s2p['s2p_id'] . '&action=disable') . '">' . tep_image('images/icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';
                      } else {
                        echo '<a href="' . tep_href_link('ship2pay.php', 'page=' . $_GET['page'] . '&s2p_id=' . $s2p['s2p_id'] . '&action=enable') . '">' . tep_image('images/icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>&nbsp;&nbsp;' . tep_image('images/icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
                      }
                ?></td>
                <td class="dataTableContent" align="right"><?php if ( (is_object($trInfo)) && ($s2p['s2p_id'] == $trInfo->s2p_id) ) { echo tep_image('images/icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link('ship2pay.php', 'page=' . $_GET['page'] . '&s2p_id=' . $s2p['s2p_id']) . '">' . tep_image('images/icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
              </tr>

 

Get the latest Responsive osCommerce CE (community edition) here .

Link to comment
Share on other sites

    if ( isset($trInfo->s2p_id) && ($s2p['s2p_id'] == $trInfo->s2p_id) ) {
      echo '              <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link('ship2pay.php', 'page=' . $_GET['page'] . '&s2p_id=' . $trInfo->s2p_id . '&action=edit') . '\'">' . "\n";
      $icon = tep_image('images/icon_arrow_right.gif', '');
    } else {
      echo '              <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link('ship2pay.php', 'page=' . $_GET['page'] . '&s2p_id=' . $s2p['s2p_id']) . '\'">' . "\n";
      $icon = '<a href="' . tep_href_link('ship2pay.php', 'page=' . $_GET['page'] . '&s2p_id=' . $s2p['s2p_id']) . '">' . tep_image('images/icon_info.gif', IMAGE_ICON_INFO) . '</a>';
    }

That's replacing 112-116.  Then at 128

                <td class="dataTableContent" align="right"><?= $icon ?>&nbsp;</td>

 

Always back up before making changes.

Link to comment
Share on other sites

On 10/17/2020 at 9:18 PM, Omar_one said:

@BrockleyJohn is there any plan to update it to Phoenix?
 

Plan would be putting it over strongly - I have been thinking it could do with revisiting now for all the changes in checkout. It could probably do with a redesign now that there are hooks all over the place - and maybe for the newly abstracted shipping & payment modules.

And of course a bootstrapped admin page.

seems like you've got an interim solution though

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Link to comment
Share on other sites

16 hours ago, ecartz said:

    if ( isset($trInfo->s2p_id) && ($s2p['s2p_id'] == $trInfo->s2p_id) ) {
      echo '              <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link('ship2pay.php', 'page=' . $_GET['page'] . '&s2p_id=' . $trInfo->s2p_id . '&action=edit') . '\'">' . "\n";
      $icon = tep_image('images/icon_arrow_right.gif', '');
    } else {
      echo '              <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link('ship2pay.php', 'page=' . $_GET['page'] . '&s2p_id=' . $s2p['s2p_id']) . '\'">' . "\n";
      $icon = '<a href="' . tep_href_link('ship2pay.php', 'page=' . $_GET['page'] . '&s2p_id=' . $s2p['s2p_id']) . '">' . tep_image('images/icon_info.gif', IMAGE_ICON_INFO) . '</a>';
    }

That's replacing 112-116.  Then at 128


                <td class="dataTableContent" align="right"><?= $icon ?>&nbsp;</td>

 

thank you @ecartz 👍

 

Get the latest Responsive osCommerce CE (community edition) here .

Link to comment
Share on other sites

10 hours ago, BrockleyJohn said:

Plan would be putting it over strongly - I have been thinking it could do with revisiting now for all the changes in checkout. It could probably do with a redesign now that there are hooks all over the place - and maybe for the newly abstracted shipping & payment modules.

its will be good if it will be a hooks .
 

 

10 hours ago, BrockleyJohn said:

And of course a bootstrapped admin page.

image.thumb.png.6add9b84c4ae520af7f1e80dca978a37.png

its work well now .. one issue .. that I can't delete the records as you see there is not delete button.. I will check it again   ..I don't think its that important just delete  the the records via phpmyadmin

Get the latest Responsive osCommerce CE (community edition) here .

Link to comment
Share on other sites

  • 11 months later...

Hi, i have same problem with shi2pay. Can you help mi (last version Phoenix) ?
 

Quote

Notice: Undefined index: action in /xxxxx/admin/ship2pay.php on line 44

 if ($_GET['action']) {
    switch ($_GET['action']) {
Quote

Notice: Undefined index: action in /home/xxxxx/admin/ship2pay.php on line 153

Notice: Undefined variable: trInfo in /home/xxxxx/admin/ship2pay.php on line 178

 switch ($_GET['action']) {
   if (is_object($trInfo)) {

I have a lot  problems with ship2pay.  In Phoenix version removed class/payment.php .

Edited by driven22
changes
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...