Jump to content

Eszaraxe

Members
  • Content count

    64
  • Joined

  • Last visited

1 Follower

Profile Information

  1. Maybe not the right thread but do anyone knwo of a similar contrib for 2.3?
  2. Have to check. Is this contrib only for 2.2 or is it working in 2.3 also?
  3. Here is the file if somebody have the time and will to help me with this <?php require_once("pr_api/payread_post_api.php"); /* $Id: pr_cc.php,v 1.1 2012/05/04 09:47:50 bihla Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ define ("PR_VERSION", "1.0.3"); class pr_cc { var $code, $title, $description, $enabled; // class constructor function pr_cc() { global $order; $this->code = 'pr_cc'; $this->title = MODULE_PAYMENT_PR_CC_TEXT_TITLE; $this->description = MODULE_PAYMENT_PR_CC_TEXT_DESCRIPTION; $this->sort_order = MODULE_PAYMENT_PR_CC_SORT_ORDER; $this->enabled = ((MODULE_PAYMENT_PR_CC_STATUS == 'True') ? true : false); $this->card_type = array( array('id' => '2', 'text' => 'VISA'), array('id' => '3', 'text' => 'MasterCard'), array('id' => '4', 'text' => 'Diners')); if ((int)MODULE_PAYMENT_PR_CC_ORDER_STATUS_ID > 0) { $this->order_status = MODULE_PAYMENT_PR_CC_ORDER_STATUS_ID; } if (is_object($order)) $this->update_status(); $thePostApi = new payread_post_api(); $this->form_action_url = $thePostApi->get_server_url(); } // class methods function update_status() { global $order; if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_PR_CC_ZONE > 0) ) { $check_flag = false; $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_PR_CC_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id"); while ($check = tep_db_fetch_array($check_query)) { if ($check['zone_id'] < 1) { $check_flag = true; break; } elseif ($check['zone_id'] == $order->billing['zone_id']) { $check_flag = true; break; } } if ($check_flag == false) { $this->enabled = false; } } } function javascript_validation() { return false; } function selection() { return array('id' => $this->code, 'module' => $this->title); } function pre_confirmation_check() { return false; } function confirmation() { return false; } function process_button() { global $order, $currencies, $customer_id; // CHANGED $thePostApi = new payread_post_api(); $round_to = $currencies->get_decimal_places($this->get_currency_code()); // LOOP for ($i=0; $i < sizeof($order->products); $i++) { $product_price_excl_vat = $order->info['currency_value'] * $order->products[$i]['final_price']; $product_vat = $product_price_excl_vat * $this->get_tax($i)/100; $product_price_incl_vat = tep_round($product_price_excl_vat + $product_vat, $round_to); $thePostApi->add_freeform_purchase( $i+1, $order->products[$i]['name'], $product_price_incl_vat, $this->get_tax($i), $order->products[$i]['qty']); } if($order->info['shipping_method'] != "") { $shipping_vat=25; $shipping_price_excl_vat = $order->info['currency_value'] * $order->info['shipping_cost']; $shipping_vat = $shipping_price_excl_vat * $shipping_vat/100; $shipping_price_incl_vat = tep_round($shipping_price_excl_vat + $shipping_vat, $round_to); $thePostApi->add_freeform_purchase( $i+1, $order->info['shipping_method'], $shipping_price_incl_vat, $shipping_vat, 1); } //$thePostApi->set_debug_mode('verbose'); $thePostApi->add_buyer_info($order->customer['firstname'], $order->customer['lastname'], $order->customer['street_address'], $order->customer['suburb'], $order->customer['postcode'], $order->customer['city'], $order->customer['country']['iso_code_2'], $order->customer['telephone'], '', /* phone work */ '', /* phone mobile */ $order->customer['email_address']); $thePostApi->set_currency($this->get_currency_code()); $thePostApi->set_test_mode(MODULE_PAYMENT_PR_CC_TESTMODE=="True"); $thePostApi->add_payment_method("card"); $thePostApi->set_success_redirect_url(htmlentities(tep_href_link(FILENAME_CHECKOUT_PROCESS))); // $thePostApi->set_error_redirect_url(htmlentities(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&status=fel'))); $thePostApi->set_authorize_notification_url(htmlentities(tep_href_link("includes/pr_callback/authorize.php"))); $thePostApi->set_settle_notification_url(htmlentities(tep_href_link("includes/pr_callback/settle.php"))); $thePostApi->set_redirect_back_to_shop_url(htmlentities(tep_href_link("index.php"))); // TODO $process_button_string = tep_draw_hidden_field('payread_agentid', $thePostApi->get_agentid()) . tep_draw_hidden_field('payread_xml_writer', $thePostApi->get_api_version()) . tep_draw_hidden_field('payread_data', $thePostApi->get_xml_data()) . tep_draw_hidden_field('payread_checksum', $thePostApi->get_checksum()); return $process_button_string; } function before_process() { return true; } function after_process() { return true; } function get_error() { global $HTTP_GET_VARS; $error = array('title' => MODULE_PAYMENT_PR_CC_TEXT_ERROR, 'error' => ((isset($HTTP_GET_VARS['error'])) ? stripslashes(urldecode($HTTP_GET_VARS['error'])) : "Default kortfel!")); return $error; } function check() { if (!isset($this->_check)) { $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PR_CC_STATUS'"); $this->_check = tep_db_num_rows($check_query); } return $this->_check; } function install() { $this->remove(); /* tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Agent ID', 'MODULE_PAYMENT_PR_CC_AGENTID', '', 'Agent ID', '6', '0' , now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Key A' , 'MODULE_PAYMENT_PR_CC_KEY_A', '', 'Enter secret key A', '6', '0' , now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Key B' , 'MODULE_PAYMENT_PR_CC_KEY_B', '', 'Enter secret key B', '6', '0' , now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Tax Override' , 'MODULE_PAYMENT_PR_CC_TAX_OVERRIDE', 'true', 'Do you want to override osCommerces tax percentage?', '6', '0' , now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Tax' , 'MODULE_PAYMENT_PR_CC_TAX', '25', 'Enter the tax percentage you want to use (numbers only ie. 25) to override osCommerces tax percentage', '6', '0' 'tep_cfg_select_option(array(\'True\', \'False\') ', now())"); */ tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Payer Module', 'MODULE_PAYMENT_PR_CC_STATUS', 'True', 'Do you want to accept creditcard payments with Payer?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Payer TestMode', 'MODULE_PAYMENT_PR_CC_TESTMODE', 'True', 'Do you want to use TestMode? (No real Creditcard debits will be made)', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_PR_CC_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0' , now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_PR_CC_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_PR_CC_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_PAYMENT_PR_CC_STATUS', 'MODULE_PAYMENT_PR_CC_TESTMODE', 'MODULE_PAYMENT_PR_CC_ORDER_STATUS_ID', 'MODULE_PAYMENT_PR_CC_ZONE', 'MODULE_PAYMENT_PR_CC_SORT_ORDER'); } // P&R internal functions. Makes sure that the amount charged to the card // is in the currency selected in the shop. Used above. function get_total_in_currency() { global $order, $currencies; $rate = isset($order->info['currency_value']) ? $order->info['currency_value'] : 1; return(tep_round($rate * $order->info['total'], $currencies->get_decimal_places($this->get_currency_code()))); } function get_tax($product) { global $order; $tax = $order->products[$product]['tax']; return $tax; } function get_currency_code() { global $order; $code = isset($order->info['currency']) ? $order->info['currency'] : "SEK"; return($code); } function obfuscate_password($password) { $obfuscation_string = "osCommerce md5 obfuscation string"; return md5($obfuscation_string . $PasswordRow["Password"] . $obfuscation_string ); } } ?>
  4. I think I have taken one step in this case. It seems to me that the problem is that the column "products_stock_attributes" in table "orders_products" is not filled in when the order is processed. So now I just have to figure out how to do this....
  5. I have a payment module for credit cards, a swedish module called Payer. It doesn't deduct stock on attributes as i should and I canät find the problem. The stock level for the main product is deducted so QTPro doctor is there everytime somebody have used the credit card module. All other payment modules works fine. I need som hint of what I should look for to make this work, where should I start, or anybody who can help me solve the problem, or help me look at the files?
  6. Eszaraxe

    Sitemap SEO

    Will this sitemap work with Ultimate SEO URLs 5 PRO?
  7. Eszaraxe

    Google XML Sitemap SEO

    Maybe the answer is somewhere in this thread, but I haven't found it. My products sitemap looks like this: <url> <loc>http://[my site]/product_info.php?products_id=368</loc> <lastmod>2012-04-16</lastmod> <changefreq>weekly</changefreq> <priority>1.0</priority> </url> <url> <loc>http://[my site]/product_info.php?products_id=126</loc> <lastmod>2012-02-29</lastmod> <changefreq>weekly</changefreq> <priority>0.7</priority> </url> I have SEO urls on and the site displays the names of the products also in the address line, shouldn't the names also be shown in the sitemap?
  8. Is the test site configured for Simple Checkout, or did I miss anything. I don't see anything different compared to the ordinary checkout?
  9. I want/need to have product_model for every attribute, is there anybody who have implemented this function in QTPro so I don't have to do it also? I am gpoing to start this now and I might need some input. My plan is to add a column named attribute_model in the table products_attributes so it is connected to products_attributes_id, which is PRIMARY in that table. After that I will add a field on the page for products attributes so I can enter a model number. For me there is no need to show the customers the model number so I don't have to implement it in the shop. I need to have it my order export form where I export all orders that will be shipped during the day so I guess it's enough to implement it there. Have I done it too simple, have I forgotten something important? All input is gladly accepted, please PM me if you have any input here you want to share.
  10. Eszaraxe

    Product Sort osc 2.3

    Yes, you should add these lines to english.php. It works for me. You have entered different numbers in the fields for sort order for the products you want to sort, and then pressed "save"?
  11. I would like to have different product numbers on different attributes, every size have it's own product number, have anybody done this. I guess I have to add a product number field to every attribute, but since QTPro is a quite complex add-on I would like to get some hints before I start, unless somebody already have done this and would like to share?
  12. Eszaraxe

    [CONTRIBUTION] Subcategory textboxes

    I guess this is the code that shows the textbox on the products page? What should I add/change so it doesn't show it several times as in my post above? <?php // category textbox mod if (DISPLAY_EXTRA_CATEGORIES == 'true' && DISPLAY_CATS_ON_PROD_LISTING == 'true'){ if ($product_check['total'] >= 1) { // now get textbox description for this *product* and display $query = tep_db_query("select categories_description from " . TABLE_EXTRA_CATEGORIES . " left join " . TABLE_PRODUCTS_TO_CATEGORIES . " using (categories_id) where " . TABLE_PRODUCTS_TO_CATEGORIES .".products_id=" . (int)$HTTP_GET_VARS['products_id'] . " and " . TABLE_EXTRA_CATEGORIES .".language_id = '" . (int)$languages_id . "'"); while($category_info_text = tep_db_fetch_array($query)){ if(!empty($category_info_text['categories_description'])){ // prevent output where description not set for particular language echo ("<div class=\"cat_info_box\">".$category_info_text['categories_description']."</div>"); } } } } ?>
  13. Eszaraxe

    [CONTRIBUTION] Subcategory textboxes

    Next issue I found with this contrib, when I choose to display the text on product page also it looks good until I put the products in 2 different categories, then I get 2 category textes on the product page. Anybody else who have ancountered this problem or anybody who have any idea of how to solve it?
  14. Eszaraxe

    [CONTRIBUTION] Subcategory textboxes

    I have installed "subcategory textboxes för 2.3 v1.2" and everything works fine. Question, Is there any way to get the category images shown in the upper right corner, like in 2.2 or in 2.3 without this contrib?
×