[TYPO3-commerce] TYPO3-project-commerce Digest, Vol 41, Issue 7 - how to render productlist

Josef Procházka pepa at comlinks.cz
Fri Jun 11 18:56:13 CEST 2010


Send TYPO3-project-commerce mailing list submissions to
	typo3-project-commerce at lists.typo3.org

To subscribe or unsubscribe via the World Wide Web, visit
	http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-commerce

or, via email, send a message with subject or body 'help' to
	typo3-project-commerce-request at lists.typo3.org

You can reach the person managing the list at
	typo3-project-commerce-owner at lists.typo3.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of TYPO3-project-commerce digest..."


Today's Topics:

   1. Question: How to render products list in an AJAX	request
      (Frank Mey)


----------------------------------------------------------------------

Message: 1
Date: Thu, 10 Jun 2010 17:44:25 +0200
From: Frank Mey <f.mey at eleveneyes.de>
Subject: [TYPO3-commerce] Question: How to render products list in an
	AJAX	request
To: typo3-project-commerce at lists.typo3.org
Message-ID:
	<mailman.23175.1276184837.610.typo3-project-commerce at lists.typo3.org>
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"

Hi list,
i'm coding an extension, which should return a product list matching 
special criterias.
All parts regarding searching the DB for attribute combinations and 
coding an eID mechanism is done.
What whould be the best way to render the resulting product list back to 
the TYPO3 page ?

Currently I'm instanciating the tx_commerce_pi1 class and try calling 
makeListView  and other methods,
but I always get errors, because not all of the TSFE framework is 
initialized (seems due to the nature of eID classes).

So do all the class methods of tx_commerce_pi1 work when called in a 
instanciated class in another extension or
are there any hooks I can use ? I dont want to do the rendering by hand 
;)...

Thx 4 info !

Mit freundlichen Gruessen
Best regards

> Send TYPO3-project-commerce mailing list submissions to
> 	typo3-project-commerce at lists.typo3.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-commerce
>
> or, via email, send a message with subject or body 'help' to
> 	typo3-project-commerce-request at lists.typo3.org
>
> You can reach the person managing the list at
> 	typo3-project-commerce-owner at lists.typo3.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of TYPO3-project-commerce digest..."
>
>
> Today's Topics:
>
>     1. Re: tx_commerce payment "debit" (Rik Willems)
>     2. Re: Variable shipping cost (Rik Willems)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 27 May 2010 13:50:09 +0200
> From: Rik Willems<rik at actiview.nl>
> Subject: Re: [TYPO3-commerce] tx_commerce payment "debit"
> To: typo3-project-commerce at lists.typo3.org
> Message-ID:
> 	<mailman.1.1274961257.27353.typo3-project-commerce at lists.typo3.org>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi Attila,
>
> As always it can be numerous things. Hard to tell from a distance.
> Do you have a price related to the payment article? The checkout always
> stops when this is not the case.
>
> Rik
>
> Op 25-5-2010 17:10, Attila Sirman schreef:
>    
>> Hello list,
>>
>> this may be a repeated question, but since I found little support on the
>> web, I feel urged to ask again:
>>
>> I am running a Typo3 (4.3.3) installation with tx_commerce (0.9.9).
>> Everything works fine, except:
>>
>> The payment procedure with "debit" chosen ends up after filling in the
>> bank details (refuses next step). I implemented the method by adding the
>> global config in /ext/commerce/ext_localconf.php. The payment article
>> appears in BE&   FE (as payment method). The included class is obviously
>> loaded since the defined locallang values and form fields appear. I have
>> no clue where the script stops.
>>
>> Any suggestions?
>> Thanks in advance for help.
>> Attila
>>      
>
> ------------------------------
>
> Message: 2
> Date: Thu, 27 May 2010 13:53:21 +0200
> From: Rik Willems<rik at actiview.nl>
> Subject: Re: [TYPO3-commerce] Variable shipping cost
> To: typo3-project-commerce at lists.typo3.org
> Message-ID:
> 	<mailman.1.1274961449.27816.typo3-project-commerce at lists.typo3.org>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi Pim,
>
> Basically I extended the article table with a field to add a certain
> amount to the delivery price. Through the hooks that Commerce provides
> you can add this amount to the total. Until now it has worked as
> expected. Please contact me if you need to know more.
>
> Cheers!
>
>
>
> Op 25-5-2010 21:36, Pim Snel schreef:
>    
>> On 2009-11-09 14:52:58 +0100, Rik Willems said:
>>
>>      
>>> I think I already found a good solution. I need to tweak it a bit and
>>> then post it here.
>>>        
>> Hi Rik,
>>
>> I'm looking for a solution for the same problem. Weight based shipping
>> costs. Can you tell us a bit more about your solution?
>>
>> Regards,
>> Pim
>>
>>      
>>> Greets, Rik
>>>
>>> Ingo Schmitt schreef:
>>>        
>>>> Hi Rik,
>>>>
>>>> http://typo3.org/extensions/repository/view/wt_individualshippingcost/current/
>>>> should be a good start.
>>>>
>>>> Regards
>>>>
>>>> Ingo
>>>>
>>>>          
>>>>> Hi all,
>>>>>
>>>>> I'm looking for a way to get variable shipping costs an easy way.
>>>>> Preferably I'd like to add a weight to a product on which a shipping
>>>>> cost can be calculated.
>>>>>
>>>>> Does anyone have something at hand I can use? There are some old
>>>>> posts mentioning this but no real solutions.
>>>>>
>>>>> Looking forward to any suggestion.
>>>>>
>>>>> Greets, Rik
>>>>> _______________________________________________
>>>>> TYPO3-project-commerce mailing list
>>>>> TYPO3-project-commerce at lists.typo3.org
>>>>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-commerce
>>>>>
>>>>>
>>>>>            
>>>>
>>>> Mit freundlichen Gruessen
>>>> Ingo Schmitt
>>>>          
>>
>>      
>
> ------------------------------
>
> _______________________________________________
> TYPO3-project-commerce mailing list
> TYPO3-project-commerce at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-commerce
>
> End of TYPO3-project-commerce Digest, Vol 40, Issue 21
> ******************************************************
>
>    

------------------------------

_______________________________________________
TYPO3-project-commerce mailing list
TYPO3-project-commerce at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-commerce

End of TYPO3-project-commerce Digest, Vol 41, Issue 7
*****************************************************
Hi Frank,

I am using this aproach. But it is just the very first version.

TS in template setup

temp.search < plugin.tx_commerceproductsearch_pi1
temp.search.form = 1
temp.search.commerce < plugin.tx_commerce_pi1
temp.search.commerce.overridePid = 42
temp.search.commerce.allArticles = 0
temp.search.targetPageId = 42
lib.search  < temp.search



require_once (t3lib_extmgm::extPath('commerce') . 'lib/class.tx_commerce_pibase.php');
require_once (t3lib_extmgm::extPath('commerce') . 'pi1/class.tx_commerce_pi1.php');
/**
 * Plugin 'Commerce Product Search' for the 'commerce_product_search' extension.
 *
 * @author	 <pepa at comlinks.cz>
 * @package	TYPO3
 * @subpackage	tx_commerceproductsearch
 */
class tx_commerceproductsearch_pi1 extends tx_commerce_pi1 {
    var $searchMessage = '';
    var $prefixId      = 'tx_commerceproductsearch_pi1';		// Same as class name
    var $scriptRelPath = 'pi1/class.tx_commerceproductsearch_pi1.php';	// Path to this script   
relative to the extension dir.
    var $extKey        = 'commerce_product_search';	// The extension key.
    var $extCommerceKey = 'commerce';
    var $pi_checkCHash = true;
    var $targetPageId ;
    var $inputErrors ;
    var $sWord = '';
   
     * The main method of the PlugIn
     *
     * @param	string		$content: The PlugIn content
     * @param	array		$conf: The PlugIn configuration
     * @return	The content that is displayed on the website
     */
    function main($content, $conf) {
        $this->conf = $conf;
        $this->pi_setPiVarDefaults();
        $this->pi_loadLL();
        $this->init($conf);
        if($conf['form']!=1) {
            $content .= $this->renderForm();
            $this->sWord = $this->piVars['input_field'];
            $content .= $this->renderSearchResult();
        }else {
            $content .= $this->renderForm();
        }
        //	 '.$this->pi_linkToPage('get to this page again',$GLOBALS['TSFE']->id).'</p>
        return $this->pi_wrapInBaseClass($content);
    }
 

    function init($conf) {
        $this->dataArr = t3lib_div::_GP($this->prefixId);
        if(!empty ($conf['targetPageId'])) {
            $this->targetPageId = $conf['targetPageId'];
        }else {
            $this->targetPageId = $GLOBALS['TSFE']->id;
        }
        $confComm = $conf['commerce.'];
        parent::init($confComm);
    }


    function renderSearchResult() {
        $ids = $this->retrieveProductsIds($this->sWord);
        $templateMarker =  array('CATEGORY_ITEMS_LISTVIEW_2','CATEGORY_ITEMS_LISTVIEW_3');
        $iterations = 2;
        $this->prefixId = 'tx_commerce_pi1';
     
        if($ids) {
        $this->searchMessage = 'Výsledky vyhledávání pro: '. $this->sWord;
        return '<p class="searchMessage">'.$this->searchMessage. '</p>'.$this-
>renderProductsForList($ids, $templateMarker, $iterations);

        }else {
        return $this->renderNoResults();

        }

    }

Regards

Pepa



More information about the TYPO3-project-commerce mailing list