|
|||||||
| Registrieren | Hilfe | Benutzerliste | Kalender | Suchen | Heutige Beiträge | Alle Foren als gelesen markieren |
|
#1
|
|||
|
|||
|
I'm doing some light adjustments on a tt_products shop
I've got two shipping options - letter or parcel Created my own typoscript values 'weightlimit' and 'replaceShipping'. If the total weight is higher than the weight limit, the below-mentioned code selects the key stored at the 'replaceShipping'-index (e.g. next payment option at index '20') However I admit this is quite a poor hardcoded hack, and it does not work 100% correctly as it is not in sync with the rest of the shop.. So I was hoping someone would share a more elegant solution or come up with some ideas. class.paymentshipping.php if ($pskey == 'shipping') { if ($calculatedArray['weight'] >= $this->conf['shipping.']['10.']['weightlimit']) if ($activeArray[0] == 10) { $activeArray[0] = $this->conf['shipping.']['10.']['weightlimit.']['replaceShipping']; unset($confArr[10]); unset($value); $actTitle = $this->conf['shipping.']['20.']['title']; } } } _______________________________________________ TYPO3-project-tt-products mailing list TYPO3-project-tt-products (AT) lists...netfielders.de http://lists.netfielders.de/cgi-bin/...ct-tt-products |
| Sponsored Links |
|
#2
|
|||
|
|||
|
Simon J skrev:
> I'm doing some light adjustments on a tt_products shop > > I've got two shipping options - letter or parcel > Created my own typoscript values 'weightlimit' and 'replaceShipping'. > If the total weight is higher than the weight limit, the below-mentioned > code selects the key stored at the 'replaceShipping'-index (e.g. next > payment option at index '20') > > However I admit this is quite a poor hardcoded hack, and it does not > work 100% correctly as it is not in sync with the rest of the shop.. So > I was hoping someone would share a more elegant solution or come up with > some ideas. > > class.paymentshipping.php > > if ($pskey == 'shipping') > { > if ($calculatedArray['weight'] >= > $this->conf['shipping.']['10.']['weightlimit']) > if ($activeArray[0] == 10) > { $activeArray[0] = > $this->conf['shipping.']['10.']['weightlimit.']['replaceShipping']; > unset($confArr[10]); > unset($value); > $actTitle = > $this->conf['shipping.']['20.']['title']; > } > } > } Ok, seems like I need to build a new function. In class.paymentshipping.php whenever I need to access basketinformation in $this->basket, the computer goes nuts, why? I need to grab the total weight, and use it for comparison with a custom typoscript-value - the weight limit _______________________________________________ TYPO3-project-tt-products mailing list TYPO3-project-tt-products (AT) lists...netfielders.de http://lists.netfielders.de/cgi-bin/...ct-tt-products |
|
#3
|
|||
|
|||
|
Simon J a écrit :
> Simon J skrev: >> I'm doing some light adjustments on a tt_products shop >> >> I've got two shipping options - letter or parcel >> Created my own typoscript values 'weightlimit' and 'replaceShipping'. >> If the total weight is higher than the weight limit, the below-mentioned >> code selects the key stored at the 'replaceShipping'-index (e.g. next >> payment option at index '20') >> >> However I admit this is quite a poor hardcoded hack, and it does not >> work 100% correctly as it is not in sync with the rest of the shop.. >> So I was hoping someone would share a more elegant solution or come up >> with some ideas. >> >> class.paymentshipping.php >> >> if ($pskey == 'shipping') >> { >> if ($calculatedArray['weight'] >= >> $this->conf['shipping.']['10.']['weightlimit']) >> if ($activeArray[0] == 10) >> { $activeArray[0] = >> $this->conf['shipping.']['10.']['weightlimit.']['replaceShipping']; >> unset($confArr[10]); >> unset($value); >> $actTitle = >> $this->conf['shipping.']['20.']['title']; >> } >> } >> } > > Ok, seems like I need to build a new function. > In class.paymentshipping.php whenever I need to access basketinformation > in $this->basket, the computer goes nuts, why? > > I need to grab the total weight, and use it for comparison with a custom > typoscript-value - the weight limit plugin.tt_products.shipping { 10.title = Parcel 10.price.type = weight 10.price.WherePIDMinPrice.155 = 7.5 10.price.1 = 1.5 10.price.500 = 2.5 10.price.1000 = 3.5 } There is already a solution for more advanced shipping calculations in tt_products 2.8.0: plugin.tt_products.shipping { 10.title = Parcel 10.price.calc { use = 10 } } plugin.tt_products.shippingcalc { 10.type = price 10.sql.where = category = 12 10.prod.250 = 4 } It would be better to improve this function. - Franz _______________________________________________ TYPO3-project-tt-products mailing list TYPO3-project-tt-products (AT) lists...netfielders.de http://lists.netfielders.de/cgi-bin/...ct-tt-products |
|
#4
|
|||
|
|||
|
Franz Holzinger skrev:
> Simon J a écrit : >> Simon J skrev: >>> I'm doing some light adjustments on a tt_products shop >>> >>> I've got two shipping options - letter or parcel >>> Created my own typoscript values 'weightlimit' and 'replaceShipping'. >>> If the total weight is higher than the weight limit, the below-mentioned >>> code selects the key stored at the 'replaceShipping'-index (e.g. next >>> payment option at index '20') >>> >>> However I admit this is quite a poor hardcoded hack, and it does not >>> work 100% correctly as it is not in sync with the rest of the shop.. >>> So I was hoping someone would share a more elegant solution or come >>> up with some ideas. >>> >>> class.paymentshipping.php >>> >>> if ($pskey == 'shipping') >>> { >>> if ($calculatedArray['weight'] >= >>> $this->conf['shipping.']['10.']['weightlimit']) >>> if ($activeArray[0] == 10) >>> { $activeArray[0] = >>> $this->conf['shipping.']['10.']['weightlimit.']['replaceShipping']; >>> unset($confArr[10]); >>> unset($value); >>> $actTitle = >>> $this->conf['shipping.']['20.']['title']; >>> } >>> } >>> } >> >> Ok, seems like I need to build a new function. >> In class.paymentshipping.php whenever I need to access >> basketinformation in $this->basket, the computer goes nuts, why? >> >> I need to grab the total weight, and use it for comparison with a >> custom typoscript-value - the weight limit > > > plugin.tt_products.shipping { > 10.title = Parcel > 10.price.type = weight > 10.price.WherePIDMinPrice.155 = 7.5 > 10.price.1 = 1.5 > 10.price.500 = 2.5 > 10.price.1000 = 3.5 > } > > > There is already a solution for more advanced shipping calculations in > tt_products 2.8.0: > > plugin.tt_products.shipping { > 10.title = Parcel > 10.price.calc { > use = 10 > } > } > > > plugin.tt_products.shippingcalc { > 10.type = price > 10.sql.where = category = 12 > 10.prod.250 = 4 > } > > It would be better to improve this function. > > > - Franz Hi Franz, Thanks, I'll try that, I can only find tt_products 2.5.13. Where's 2.8 located? Have a great summer ![]() Simon _______________________________________________ TYPO3-project-tt-products mailing list TYPO3-project-tt-products (AT) lists...netfielders.de http://lists.netfielders.de/cgi-bin/...ct-tt-products |
|
#5
|
|||
|
|||
|
Simon Justesen a écrit :
> Hi Franz, > > Thanks, I'll try that, I can only find tt_products 2.5.13. Where's 2.8 > located? > > Have a great summer ![]() > > Simon Hello Simon, tt_products in version 2.8.0 beta is available to sponsors only at http://ttproducts.de . http://ttproducts.de/tt_products_ext.html?&tt_products[backPID]=7&tt_products[product]=1&cHash=72944411fe It will be in TER about 3 years after having been marked as 'stable'. Greetings, Franz _______________________________________________ TYPO3-project-tt-products mailing list TYPO3-project-tt-products (AT) lists...netfielders.de http://lists.netfielders.de/cgi-bin/...ct-tt-products |
| Lesezeichen |
| Themen-Optionen | |
| Ansicht | Thema bewerten |
|
|
|
||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| [TYPO3-shop] Hide shipping method when weight higher than... | Simon Justesen | typo3-project-tt-products@lists.netfielders.de | 0 | 10.03.2009 17:15 |
| [TYPO3-shop] Weight without decimal places (T3 <4.2.3;tt_prod v1.7.1) | Franz Gutsch | typo3-project-tt-products@lists.netfielders.de | 1 | 28.01.2009 19:14 |
| [TYPO3-shop] checkout requirement: minimum weight in basket | Heiko Hänsge | typo3-project-tt-products@lists.netfielders.de | 1 | 28.11.2008 12:30 |
| [TYPO3-shop] How to hide shipping address prompt in "pick up in thestore" purchases (no shipping) | Juan Pablo Villaverde | typo3-project-tt-products@lists.netfielders.de | 1 | 04.07.2008 16:35 |
| [TYPO3] tt_products: calculate shipping costs depending on country | Andreas Förthner | typo3-english@lists.netfielders.de | 0 | 02.03.2007 14:21 |