CVS edit link for netbabu

I have been a drupal developer for the past 3 years. Now, I have just created a module that will enable users to publish all ubercart products as an XML feed into Kelkoo store (http://www.kelkoo.co.uk). Of course, the feed needs to be approved by Kelkoo staff(http://www.kelkoo.co.uk/co_4292-online-merchants-and-stores-partner-with...) before products are published.

I am not affiliated with kelkoo in any way but I have helped my ecommerce clients by developing this module. My module is ready and tested.

CommentFileSizeAuthor
#4 kelkoo.zip3 KBnetbabu
#1 kelkoo.zip8.3 KBnetbabu

Comments

netbabu’s picture

Title: netbabu [netbabu] » Kelkoo Feed - module submission
Status: Postponed (maintainer needs more info) » Needs review
Issue tags: +Ubercart, +FEED, +xml, +ecommerce, +merchant, +shopping, +products
StatusFileSize
new8.3 KB

I am attaching the full module as zip.

Description
========

Kelkoo is a leading shopping site in UK/Europe and currently taken over by Yahoo. If you are running an ecommerce/shopping site in Ubercart, you will be tempted to publish your products to Kelkoo store. However, it takes a lot of time to find get proper documentation from Kelkoo staff for publishing/uploading your products. We have undergone this process and hence I hope this module help a lot of people in the drupal community.

Once the module is enable, it creates an XML link containing all products from your ubercart store(excluding those out of stock products). XML link will be in the format:

http://www.yoursite.com/products/kelkoo.xml

You just need to submit the above link to Kelkoo representative and your products will be published in kelkoo store after they approve it.

Kelkoo module is sponsored by http://paramprojects.com

avpaderno’s picture

Title: Kelkoo Feed - module submission » netbabu [netbabu]
Issue tags: -Ubercart, -FEED, -xml, -ecommerce, -merchant, -shopping, -products +Module review

Hello, and thanks for applying for a CVS account. I am adding the review tags, and some volunteers will review the code, pointing out what it needs to be changed.

avpaderno’s picture

Status: Needs review » Needs work
  • The points reported in this review are not in order or importance / relevance.
  • Most of the times I report the code that present an issue. In such cases, the same error can be present in other parts of the code; the fact I don't report the same issue more than once doesn't mean the same issue is not present in different places.
  • Not all the reported points are application blockers; some of the points I report are simple suggestions to who applies for a CVS account. For a list of what is considered a blocker for the application approval, see CVS applications review, what to expect. Keep in mind the list is still under construction, and can be changed to adapt it to what has been found out during code review, or to make the list clearer to who applies for a CVS account.
  1. The version line needs to be removed from the .info file.
  2. License files cannot be committed in Drupal.org repository. Projects committed in Drupal.org repository have the same license used by Drupal.
  3. See http://drupal.org/coding-standards to understand how a module should be written. In particular, see how the code should be formatted.
  4.   // Get active products
      $result = db_query("SELECT node.nid FROM {uc_products} INNER JOIN {node} ON uc_products.nid = node.nid WHERE node.status = 1");
      while ($node = db_fetch_object($result)) {
        $product = node_load($node->nid);
        
        //begin stock checking
        $stock = uc_stock_level($product->model );
        if($stock <= 0)
        {
          continue;
        }
        //end stock stocking
        
        // Grab terms for products
        $terms = array();
        foreach ($product->taxonomy as $term) {
          $ancestors = taxonomy_get_parents_all($term->tid);
          foreach ($ancestors as $ancestor) {
            $terms[] = $ancestor->name;
          }
        }
    
    			// Build kelkoo
    	$output .= "<Product>\n";
       // $output .= "<Category>" . check_plain($product->title) . "</Category>\n";
        $output .= "<Category>" . check_plain(implode(', ', $terms)) . "</Category>\n";
    	$output .= "<department>" . check_plain(implode(', ', $terms)) . "</department>\n";
        $output .= "<UniqueCode>" . htmlentities($product->model) . "</UniqueCode>\n";
    	$output .= "<Description>" . check_plain($product->body) . "</Description>\n";
        if (isset($product->field_image_cache) && file_exists($product->field_image_cache[0]['filepath']))
    	{
          $output .= "<image_link>" . $GLOBALS['base_url'] .'/'. ($product->field_image_cache[0]['filepath']) . "</image_link>\n"; 
        }
        $output .= "<LinkToProduct>" . $GLOBALS['base_url'] . '/node/' . $product->nid . "</LinkToProduct>\n";
        $output .= "<weight>" . $product->weight . ' ' . $product->weight_units . "</weight>\n";
        $output .= "<price>" . $product->sell_price . "</price>\n";
        $output .= "<product_type>" . check_plain(implode(',', $terms)) . "</product_type>\n";
    	
    	$output .= "<discount>" .check_plain($product->discount) . "</discount>\n";
    	//$output .= "<>" .check_plain(
    	
    
    

    The code is showing node data without to first verify if the user has access to the node. This is considered a security issue.
    The function to use to get a Drupal URL is url().

  5. The module doesn't implement hook_uninstall().
netbabu’s picture

StatusFileSize
new3 KB

Ok, I have implemented the suggestions and guidelines mentioned by you.

Please check if this attached version is ok.

avpaderno’s picture

Assigned: Unassigned » avpaderno
Status: Needs work » Needs review

I will review the code tomorrow.

avpaderno’s picture

Status: Needs review » Fixed

Thank you for your contribution! I am going to update your account.

These are some recommended readings to help with excellent maintainership:

You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

I thank all the dedicated reviewers as well.

Status: Fixed » Closed (fixed)
Issue tags: -Module review

Automatically closed -- issue fixed for 2 weeks with no activity.

avpaderno’s picture

Component: Miscellaneous » new project application
Issue summary: View changes
avpaderno’s picture

Issue summary: View changes