[TH] Credits: Shop

[TH] Credits: Shop [Paid] 1.0.7

No permission to buy ($20.00)

iamjudd

Active member
Please describe more detail about custom product. Will be better if you can show it in a live demo site. Thanks

dzLpasl.png
It's slightly misleading. You can add custom products which are just new products for certain permissions you can allow. You can't make a true custom products to say sell a file, or something for a game or a game itself or whatever else you can think of.
 

Jake B.

Well-known member
It's slightly misleading. You can add custom products which are just new products for certain permissions you can allow. You can't make a true custom products to say sell a file, or something for a game or a game itself or whatever else you can think of.

Sure you can. It's very easy to extend and add your own custom product types. Just extend
Audentio_Credit_Shop_Model_ProductType::_productTypes() and create your own Product Type Handler to reference from there.
 

iamjudd

Active member
Can you guys supply documentation on how to do so because I have not seen how to do this. I have only been able to do permission based products.
 

Jake B.

Well-known member
Please describe more detail about custom product. Will be better if you can show it in a live demo site. Thanks

dzLpasl.png
Not really something you can show in a demo. All you need to do is extend the
Audentio_Credit_Shop_Model_ProductType class, specifically the _productTypes() method to add your own product type such as this:

Code:
<?php
class YourAddon_Proxy_Audentio_Credit_Shop_Model_ProductType extends XFCP_YourAddon_Proxy_Audentio_Credit_Shop_Model_ProductType
{
    protected function _productTypes()
    {
        return parent::_productTypes() + array(
            'CustomType'                => array(
                'product_type'            => 'CustomType', // This should be the same as the key for the array
                'product_type_title'    => 'Just a custom product type', // The name of the product type -- this will show up in the AdminCP when you create a new product, you should probably use a phrase for this.
                'callback_class'        => 'YourAddon_ProductType_CustomType', // The class to use for this Product Type -- This handles what happens when you buy the product, or use it.
            ),
        );
    }
}

if (false)
{
    // This is just here for better code hints in IDEs.
    class XFCP_YourAddon_Proxy_Audentio_Credit_Shop_Model_ProductType extends
Audentio_Credit_Shop_Model_ProductType {}
}

Then look at one of the included ProductType handlers for an example of how they work.

You'll (obviously) need some development experience for this.

- Jake
 

SoeHoe

Active member
It's slightly misleading. You can add custom products which are just new products for certain permissions you can allow. You can't make a true custom products to say sell a file, or something for a game or a game itself or whatever else you can think of.
Oh, i see,,, sorry and thanks :)
 

m1ne

Well-known member
Error in latest version @Jake B.

Code:
Zend_Db_Statement_Mysqli_Exception: Mysqli prepare error: Unknown column 'product.display_on_profile_inventory' in 'field list' - library/Zend/Db/Statement/Mysqli.php:77
Generated By: Unknown Account, 55 minutes ago

Code:
#0 /var/www/vhosts/wweforums.net/httpdocs/library/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('\n\t\t\tSELECT purc...')
#1 /var/www/vhosts/wweforums.net/httpdocs/library/Zend/Db/Adapter/Mysqli.php(381): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), '\n\t\t\tSELECT purc...')
#2 /var/www/vhosts/wweforums.net/httpdocs/library/Zend/Db/Adapter/Abstract.php(478): Zend_Db_Adapter_Mysqli->prepare('\n\t\t\tSELECT purc...')
#3 /var/www/vhosts/wweforums.net/httpdocs/library/XenForo/Model.php(219): Zend_Db_Adapter_Abstract->query('\n\t\t\tSELECT purc...', Array, 2)
#4 /var/www/vhosts/wweforums.net/httpdocs/library/Audentio/Credit/Shop/Model/ProductPurchase.php(56): XenForo_Model->fetchAllKeyed('\n\t\t\tSELECT purc...', 'purchase_id', Array)
#5 /var/www/vhosts/wweforums.net/httpdocs/library/Audentio/Credit/Shop/CronEntry/ExpireProduct.php(12): Audentio_Credit_Shop_Model_ProductPurchase->getExpiredPurchases(Array)
#6 [internal function]: Audentio_Credit_Shop_CronEntry_ExpireProduct::run(Array)
#7 /var/www/vhosts/wweforums.net/httpdocs/library/XenForo/Model/Cron.php(357): call_user_func(Array, Array)
#8 /var/www/vhosts/wweforums.net/httpdocs/library/XenForo/Deferred/Cron.php(24): XenForo_Model_Cron->runEntry(Array)
#9 /var/www/vhosts/wweforums.net/httpdocs/library/XenForo/Model/Deferred.php(294): XenForo_Deferred_Cron->execute(Array, Array, 7.9999990463257, '')
#10 /var/www/vhosts/wweforums.net/httpdocs/library/XenForo/Model/Deferred.php(428): XenForo_Model_Deferred->runDeferred(Array, 7.9999990463257, '', false)
#11 /var/www/vhosts/wweforums.net/httpdocs/library/XenForo/Model/Deferred.php(373): XenForo_Model_Deferred->_runInternal(Array, NULL, '', false)
#12 /var/www/vhosts/wweforums.net/httpdocs/deferred.php(23): XenForo_Model_Deferred->run(false)
#13 {main}
 

Jake B.

Well-known member
Error in latest version @Jake B.

Code:
Zend_Db_Statement_Mysqli_Exception: Mysqli prepare error: Unknown column 'product.display_on_profile_inventory' in 'field list' - library/Zend/Db/Statement/Mysqli.php:77
Generated By: Unknown Account, 55 minutes ago

Code:
#0 /var/www/vhosts/wweforums.net/httpdocs/library/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('\n\t\t\tSELECT purc...')
#1 /var/www/vhosts/wweforums.net/httpdocs/library/Zend/Db/Adapter/Mysqli.php(381): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), '\n\t\t\tSELECT purc...')
#2 /var/www/vhosts/wweforums.net/httpdocs/library/Zend/Db/Adapter/Abstract.php(478): Zend_Db_Adapter_Mysqli->prepare('\n\t\t\tSELECT purc...')
#3 /var/www/vhosts/wweforums.net/httpdocs/library/XenForo/Model.php(219): Zend_Db_Adapter_Abstract->query('\n\t\t\tSELECT purc...', Array, 2)
#4 /var/www/vhosts/wweforums.net/httpdocs/library/Audentio/Credit/Shop/Model/ProductPurchase.php(56): XenForo_Model->fetchAllKeyed('\n\t\t\tSELECT purc...', 'purchase_id', Array)
#5 /var/www/vhosts/wweforums.net/httpdocs/library/Audentio/Credit/Shop/CronEntry/ExpireProduct.php(12): Audentio_Credit_Shop_Model_ProductPurchase->getExpiredPurchases(Array)
#6 [internal function]: Audentio_Credit_Shop_CronEntry_ExpireProduct::run(Array)
#7 /var/www/vhosts/wweforums.net/httpdocs/library/XenForo/Model/Cron.php(357): call_user_func(Array, Array)
#8 /var/www/vhosts/wweforums.net/httpdocs/library/XenForo/Deferred/Cron.php(24): XenForo_Model_Cron->runEntry(Array)
#9 /var/www/vhosts/wweforums.net/httpdocs/library/XenForo/Model/Deferred.php(294): XenForo_Deferred_Cron->execute(Array, Array, 7.9999990463257, '')
#10 /var/www/vhosts/wweforums.net/httpdocs/library/XenForo/Model/Deferred.php(428): XenForo_Model_Deferred->runDeferred(Array, 7.9999990463257, '', false)
#11 /var/www/vhosts/wweforums.net/httpdocs/library/XenForo/Model/Deferred.php(373): XenForo_Model_Deferred->_runInternal(Array, NULL, '', false)
#12 /var/www/vhosts/wweforums.net/httpdocs/deferred.php(23): XenForo_Model_Deferred->run(false)
#13 {main}

Did you run the update script?
 

iamjudd

Active member
You know I went to upgrade the addon and it just went back to the list of addons and still shows the previous version number.
Trying to rebuild the addon..
 

Jake B.

Well-known member
You know I went to upgrade the addon and it just went back to the list of addons and still shows the previous version number.
Trying to rebuild the addon..

D'oh! I included the incorrect XML file. Watch for an e-mail in about 5 minutes. @Solidus

I haven't gotten the updates to this or the credits addon.

Please send me a PM with your e-mail address. We may have the incorrect one saved.
 

m1ne

Well-known member
Can't upgrade Shop with the new xml,

Code:
Mysqli statement execute error : Duplicate column name 'max_active_purchases'

Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 297
Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479
Zend_Db_Adapter_Abstract->query() in Audentio/Credit/Shop/Listener/Install/1000301.php at line 21
Audentio_Credit_Shop_Listener_Install_1000301::run() in Audentio/Credit/Shop/Listener/Install.php at line 28
Audentio_Credit_Shop_Listener_Install::run()
call_user_func() in XenForo/Model/AddOn.php at line 215
XenForo_Model_AddOn->installAddOnXml() in ConvEss/Model/AddOn.php at line 24
ConvEss_Model_AddOn->installAddOnXml() in XenForo/Model/AddOn.php at line 169
XenForo_Model_AddOn->installAddOnXmlFromFile() in XenForo/ControllerAdmin/AddOn.php at line 236
XenForo_ControllerAdmin_AddOn->actionUpgrade() in XenForo/FrontController.php at line 347
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
XenForo_FrontController->run() in /var/www/vhosts/wweforums.net/httpdocs/admin.php at line 13
 
Top