简体   繁体   中英

Export option in shopp plugin

I am using shopp plugin for paypal in my wordpress site. In that there is an 'export options' in shopp->orders page. The function for exporting the orders in the purchased page is

function exportcolumns () {
        $prefix = "p.";
        return array(
            $prefix.'id' => __('Line Item ID','Shopp'),
            $prefix.'optionlabel' => __('Product Variation Name','Shopp'),
            $prefix.'description' => __('Product Description','Shopp'),
            $prefix.'sku' => __('Product SKU','Shopp'),
            $prefix.'quantity' => __('Product Quantity Purchased','Shopp'),
            $prefix.'unitprice' => __('Product Unit Price','Shopp'),
            $prefix.'total' => __('Product Total Price','Shopp'),
            $prefix.'data' => __('Product Data','Shopp'),
            $prefix.'downloads' => __('Product Downloads','Shopp')
            );
    }

In this $prefix.'optionlabel' => __('Product Variation Name','Shopp') , contains the value 3482 Gouchh, Two Sems, With Insurance in a single field. I have to separate it into 3 fields while exporting as xls.

How can I do that?

In my experience, the best reason to export anything from Shopp is to move it to a different shopping cart platform.

I used Shopp for over a year on several sites, and it was never anything but a nightmare. It remained buggy, presented security problems. If you engage the logging you'll see that the code is SO SLOPPY that it constantly throws PHP errors.

EVERY update they did broke my sites and left me hemorrhaging money - while they jerked me around in their "support" area, delaying to extort money - and offering to repair the sites their junkware broke - for $500 EACH.

Strongly recommend getting away from Shopp.

I'm not sure if I have misunderstood your question, but if you have a string value that you want to extrapolate, explode is the function you need.

Assuming your product is stored in the $product variable

$export=explode(', ',$product['p.optionlabel']);

Will provide

array(3)
(
  [0] => string(11) "3482 Gouchh"
  [1] => string(8) "Two Sems"
  [2] => string(14) "With Insurance"
)

You can then use this to do your export.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM