Jump to content

weejimmy

Member
  • Posts

    2
  • Joined

  • Last visited

Recent Profile Visitors

1,349 profile views

weejimmy's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Not to worry. I found it in cubecart.class.php. Added a bit of logic to change the select on the gateway modules depending on the customer group the user was in and bingo. Sagepay shown for retail. B2B gets Sagepay or the Print Form option. Not the most elegant bit of code as it relies on hard coded customer groups and knowledge of which gateways are being used, but hey ho! # SMD specific code. Work out if the user is B2B (Group 1) or not. If not, we only offer Sagepage. If they are, we offer what is enabled $query = sprintf('SELECT * FROM %1$sCubeCart_customer_membership cm, %1$sCubeCart_customer_group cg WHERE cm.customer_id=%2$d AND cm.group_id=1 and cm.group_id=cg.group_id', $GLOBALS['config']->get('config', 'dbprefix'), $GLOBALS['user']->getId()); if ($userB2B = $GLOBALS['db']->query($query, $per_page, $page)) { // We got something so it is B2B. Show anything enabled $where = array('module' => 'gateway', 'status' => '1'); } else { // Not B2B - only show Sagepay $where = array('module' => 'gateway', 'status' => '1', 'folder' => 'SagePay'); }
  2. Hi All, I am new to Cubecart having stepped in to try and help out a friend who uses it for his online store using CC v5.1.5. I've done a fair amount of PHP and mySQL development before with my job and have successfully made a number of changes to the standard product import and export code as my pal is black-belt in Excel and likes to do all his product management and pricing offline via CSV and then reimport his inventory with the changes. This doesnt work very well with the basic import and export as not all the inventory fields are exported, so I've modified the export and import to handle the following for each product: Secondary Categories Multiple Images Multiple price groups (Retail, B2B and 'special') Date Added (now keeps original date across export and imports) Digital path (for PDF's etc) We've also added the following 'read only' informational fields to the export to help him work in Excel Category names so he doesn't need to remember the codes (both main and any secondary categories) Last update time stamp So far so good and that all seems to be fine and he is now happily mastering his inventory from Excel. His next 'want' is to be able to condition which Payment Gateways are shown depending on the customer groups the customer belongs to during checkout. The plan is to use Sage for retail customers and Print Order Form for B2B, allowing B2B to just place orders (as they generally have credit). He doesn't want retail customers to see Print Order Form as an option. Which is where I am struggling!!! I am fine making changes to straight PHP that has obvious SQL calls, but am having less luck with the customer facing code - in this case the Payment Gateway page. I found content.gateway.php in the skins templates folder and can see that control the layout of the page, but I am unsure what is defining $GATEWAYS. I figure that would be the place to change things as I want a reduced set back on the customer groups of the user. Can anyone point me in the right direction?
×
×
  • Create New...