Jump to content

hobbynet

Members
  • Content count

    12
  • Joined

  • Last visited

1 Follower

About hobbynet

  • Birthday 05/16/1961

Profile Information

  1. hobbynet

    NEW! Complete Order Editing Tool!

    Hi, First of all I like to thanks to all developers created this great contribution. Without it the work with creating order or modifying it can be a pain. Idea for a enhancement: By default the contribution has the possibility to define which total modules are added by default for a new manual created order. But, in 90% some total modules e.g. discount wont be used for a "normal" order. By default I'm using the totals as follows in the total section: Subtotal Shipping including Tag % Total Net withou Tax Rounding difference Total But some time I need to add a new line in the total for "discount". I'm doing this by click on the "+", type "Discount 5%" in the title and the related value. Everything goes well and the order will be calculated and stored correctly. But, take a look into the orders_total table for the created order. The new discount line becomes a class = ot_custom_xy and a sort_order=xy. In my point of view this is wrong. Why? The discount module has a defined title, class=ot_customer_discount and a sort_order=3. To make sure all the calculation in the reports or stats will get the correct values, you have to modify the class and for the correct printing in "invoice" you have to modify the sort_order. Else the discount will be placed above the Subtotal. My idea: Is it possible to enhance the total section in a way to select the available total modules from within a dropdown? With this all the related values for class, sort_order, title will get the defined values automatically. The dropdown must also have the possibility to type in a free text. The code logic has to handle it as: if the text can't be found from the list of available modules the title will be set as type in, the class can be set to ot_custom_xy and the sort_order can be set to xy. This is what I like to enhance in the order editing tool and I like to ask you about idea how to implement it. I'm looking forward to read some lines about. regards peter
  2. Hi Marcus, Do you now installed my enhanced function? Please post the lines as follows: $remove_array_general = array(... $remove_array_page = array(... It seems the cpath and products_id arn't defined for removal. regards peter
  3. Hi Marcus, I've enhanced the function CanonicalLink to specifiy a removal array for general and removal array for a specific page. Why to specify removal tag for a specific page? Take a look at the product_info.php if it's selected from the online store. The canonical link only show as <link rel="canonical" href="........../product_info.php?products_id=494" /> but if you select on the start page a manufacturer and after select a product the new canonical link will includes the manufacturers_id as <link rel="canonical" href="...../product_info.php?manufacturers_id=23&products_id=494" /> but these two canonicals will go into the duplicates in google so the manufactureres_id has to be removed in product_info.php. The thing is, the manufactureres_id do not have to remove for the index.php So if you define the manufactueres_id in the original $remove_array array the tag will be removed in any page. The complete function look now like: // remove duplicate content with canonical tag by Spooks 12/2009 function CanonicalLink( $xhtml = false , $ssl = 'SSL' ) { global $request_type; $close_tag = ( false === $xhtml ? ' >' : ' />' ); $spage = ''; $domain = ( $request_type == 'SSL' && $ssl == 'SSL' ? HTTPS_SERVER : HTTP_SERVER ); // gets the base URI // Find the file basename safely = PHP_SELF is unreliable - SCRIPT_NAME can show path to phpcgi if ( array_key_exists( 'SCRIPT_NAME', $_SERVER ) && ( substr( basename( $_SERVER['SCRIPT_NAME'] ), -4, 4 ) == '.php' ) ) { $basefile = basename( $_SERVER['SCRIPT_NAME'] ); } elseif ( array_key_exists( 'PHP_SELF', $_SERVER ) && ( substr( basename( $_SERVER['PHP_SELF'] ), -4, 4 ) == '.php' ) ) { $basefile = basename( $_SERVER['PHP_SELF'] ); } else { // No base file so we have to return nothing return false; } // Don't produce canonicals for SSL pages that bots shouldn't see $ignore_array = array( 'account', 'address', 'checkout', 'login', 'password', 'logoff' ); // partial match to ssl filenames foreach ( $ignore_array as $value ) { $spage .= '(' . $value . ')|'; } $spage = rtrim($spage,'|'); if (preg_match("/$spage/", $basefile)) return false; // REQUEST_URI usually doesn't exist on Windows servers ( sometimes ORIG_PATH_INFO doesn't either ) if ( array_key_exists( 'REQUEST_URI', $_SERVER ) ) { $request_uri = $_SERVER['REQUEST_URI']; } elseif( array_key_exists( 'ORIG_PATH_INFO', $_SERVER ) ) { $request_uri = $_SERVER['ORIG_PATH_INFO']; } else { // we need to fail here as we have no REQUEST_URI and return no canonical link html return false; } //hobbynet: deactivate the original array setting code //$remove_array = array( 'currency','language','main_page','page','sort','ref','affiliate_banner_id','max'); //hobbynet: set parms to be removed in general // Add to this array any additional params you need to remove in the same format as the existing $remove_array_general = array( 'currency','language','main_page','page','sort','ref','affiliate_banner_id','max','view_all'); //hobbynet: set parms to be remove for each defined page //hobbynet: can be enhanced with the page-name e.g. specials.php as the key and set the parms to be removed in the second array //hobbynet: keep in mind; each page-specific array entry has to be splitted with "," (comma) $remove_array_page = array('product_info.php' => array('manufacturers_id','cPath') // e.g. manufacturers_id has to be removed in product_info.php ,'index.php' => array() // e.g. nothing to remove in addition to the general-remove-array in index.php ,'allprods.php' => array('fl') ,'specials.php' => array('action') ); //hobbynet: merge arrays together general-removal-array and page-specific-removal_array //hobbynet: $basefile is set to the current requested page //hobbynet: get the page-specific-removal-array keyed by the value in $basefile with "$remove_array_page[$basefile]" $remove_array_merged = array_merge($remove_array_general, $remove_array_page[$basefile]); //hobbynet: use the new $remove_array_merged in stead of the orig. $remove_array foreach ( $remove_array_merged as $value ) { $search[] = '/&*' . $value . '=\w*/'; } $search[] = ('/&*osCsid.*/'); $search[] = ('/\?\z/'); $request_uri = preg_replace('/\?&/', '?', preg_replace($search, '', $request_uri )); echo '<link rel="canonical" href="' . $domain . $request_uri . '"' . $close_tag . PHP_EOL; } /// located in the file mentioned by Sam hope this help. regards peter
  4. Hi Marcus, You can place the buy_now.php in robots.txt as follows: User-agent: * Disallow: /buy_now.php Disallow: /catalog/buy_now.php If you have an existing list of files you only have to add the two "dissallow" lines. The line "User-agent: *" will prevent all agents to access the listed files. But - not all spiders (bad agents) will properly handle the robots.txt You can also prevent the google-image-spider to access your images by adding: User-agent: Googlebot-Image Disallow: / Disallow: /catalog/ Disallow: /catalog Hope this help kind regards peter
  5. Hi Marcus, Oh, it seems your problem is related to the search-engine-frindly-url. The SEFU will handle the url in a other way as it handled "normaly". In normal mode the url will be allprods.php?sort=2a&page=2 the SEFU will generate the same url as /allprods.php/sort/2a/page/2. I do not realy know whether the "Replying to Remove & Prevent duplicate ... with canonical tag" can handle the url's generated by the SEFU-module. If you like to remove the products_id for special.php you have to set it to: $remove_array_page = array('product_info.php' => array('manufacturers_id') // e.g. manufacturers_id has to be removed in product_info.php ,'index.php' => array() // e.g. nothing to remove in addition to the general-remove-array in index.php ,'allprods.php' => array('fl') ,'specials.php' => array('products_id') ); Please ignore the product_info, index.php, allprods.php line within the array. If you like you can send me your lines defining the $remove_array_page regards peter
  6. Hi Sam, I have implement some line of code within you function. Please take a look: //hobbynet: deactivate the original array setting code //$remove_array = array( 'currency','language','main_page','page','sort','ref','affiliate_banner_id','max'); // Add to this array any additional params you need to remove in the same format as the existing //hobbynet: set parms to be removed in general $remove_array_general = array( 'currency','language','main_page','page','sort','ref','affiliate_banner_id','max'); //hobbynet: set parms to be remove for each defined page //hobbynet: can be enhanced with the page-name e.g. specials.php as the key and set the parms to be removed in the second array //hobbynet: keep in mind; each page-specific array entry has to be splitted with "," (comma) $remove_array_page = array('product_info.php' => array('manufacturers_id') // e.g. manufacturers_id has to be removed in product_info.php ,'index.php' => array() // e.g. nothing to remove in addition to the general-remove-array ); //hobbynet: merge arrays together general-removal-array and page-specific-removal_array //hobbynet: $basefile is set to the current requested page //hobbynet: get the page-specific-removal-array keyed by the value in $basefile with "$remove_array_page[$basefile]" $remove_array_merged = array_merge($remove_array_general, $remove_array_page[$basefile]); //hobbynet: use the new $remove_array_merged in stead of the orig. $remove_array foreach ( $remove_array_merged as $value ) { It will work and it will remove e.g. the manufacturers_id in product_info.php but not in index.php or other pages Kind regards peter
  7. Hi Sam, I've downloaded and testing now the fuctionality for this great contribution. Right now I don't call the function within the header_tags.php, in stead I call it within each page I need. After my test I would implement it as you suggest. Now I saw the possibility to enhance the remove-parm-array and I added the manufacturers_id. Right now in each page I'm using the function "CanonicalLink" the parm manufacturers_id will be removed in the generated tag <link rel="canonical". This should be the solution for product_info.php but not for the index.php if I select by the manufacturer-drop down. generated canonical tag in (manufacturer-id selected = 62 (in my case Kokam): index.php = http://www.hobbynet.ch/shop/index.php? in stead of http://www.hobbynet....facturers_id=62 product_info.php = <link rel="canonical" href="http://www.hobbynet.ch/shop/product_info.php?products_id=1410" /> this is ok to prevent duplicates e.g. <link rel="canonical" href="http://www.hobbynet.ch/shop/product_info.php?manufacturers_id=62&products_id=1410" /> links to the same page due to the products_id=1410 question: Is it possible to enhance the array with the page name as a key? In that way it is possible to set the removed parm for each page seperatly. The lookup code must then be enhanced to search within the array with the current page. Im looking forward to read some lines about. kind regards peter
  8. hobbynet

    remove parms array

    Hi, I've downloaded and testing now the fuctionality for this great contribution. Right now I don't call the function within the header_tags.php, in stead I call it within each page I need. After my test I would implement it as you suggest. Now I saw the possibility to enhance the remove-parm-array and I added the manufacturers_id. Right now in each page I'm using the function "CanonicalLink" the parm manufacturers_id will be removed in the generated tag <link rel="canonical". This should be the solution for product_info.php but not for the index.php if I select by the manufacturer-drop down. generated canonical tag in (manufacturer-id selected = 62 (in my case Kokam): index.php = http://www.hobbynet.ch/shop/index.php? in stead of http://www.hobbynet.ch/shop/index.php?manufacturers_id=62 product_info.php = <link rel="canonical" href="http://www.hobbynet.ch/shop/product_info.php?products_id=1410" /> this is ok to prevent duplicates e.g. <link rel="canonical" href="http://www.hobbynet.ch/shop/product_info.php?manufacturers_id=62&products_id=1410" /> links to the same page due to the products_id=1410 question: Is it possible to enhance the array with the page name as a key? In that way it is possible to set the removed parm for each page seperatly. The lookup code must then be enhanced to search within the array with the current page. Im looking forward to read some lines about. kind regards peter
  9. hobbynet

    [contribution] Tracking Module

    Hi, I'm trying to integrate this great contribution. Everything works find - but: 1) I tryed to enter a tracking-id within an order and then click on "update" 2) now I got an error: Fatal error: Call to a member function on a non-object in ../admin/orders.php on line 118 The line within "orders.php" that fire the error looks like: $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]) . $notify_comments . ----> this is the error line : $tracking->email_add_tracking() . "\n\n" . // added tracking_module sprintf(EMAIL_TEXT_STATUS_UPDATE2); It seems, that the called function ins't present within the tracking_module.php but the function is there ;-(( I also tryed to call other function but I got the same error. Are there others with the same error? Have somebody a solution about? Any ideas are welcome kind regards peter
  10. hobbynet

    NEW! Complete Order Editing Tool!

    Hi, Try to edit: catalog/admin/order_editor/javascript.php In there it is a function called "openWindow" function openWindow(file, windowName) { msgWindow = window.open(file, windowName,'top=250, left=250, width=550, height=450, location=0, status=1, toolbar=0, resize=1'); if (!msgWindow.opener) msgWindow.opener = self; } You can easy change the value in width=xxx and height=xxx Hope this helps regards peter
  11. hobbynet

    NEW! Complete Order Editing Tool!

    Hi, I'm using this great contribution within my shop. It's very usefull to modify existing orders. Is there a way to integrate a dropdown to select the ot_xy? All new custom subtotals are added with ot_custom1..n. To get all created reports showed the summary displayed right I have to update the orders_totals table manually. If there is a way to select addition os_xx e.g. Discount it would be possible to insert it with the right class_id/class_name during the edit-order process. Any ideas are welcome. regards peter
  12. hobbynet

    NEW! Complete Order Editing Tool!

    Hi, I have some problems with the order editor (ajax enabled) and our nice german "umlaute" like ö ü ä. Are there others with the same problem? All ideas and solutions are welcome kinde regards peter
×