Forum Replies Created

Viewing 15 replies - 1 through 15 (of 21 total)
  • Thanks so much for confirming this. It was driving me mad. Will be patient for a fix.

    I have the same problem since 5.7.1 update. Price does not get saved (or displayed) if the GUTENBERG BLOCK EDITOR is enabled for editing. If I turn off the Block Editor then I can set, and save price.

    Thread Starter Mediatricks

    (@mediatricks)

    So you want to add a transaction ID even before the transaction is marked as COMPLETE?

    This is doable? You can update the UpdateSaleReserved function from Step 2 above as follows:

    ————

    // Update Set a Booking to RESERVED
    function UpdateSaleReserved($saleId)
    {

    $txnid = substr(md5(microtime()),rand(0,26),16);
    date_default_timezone_set(‘Asia/Kuwait’);
    $date = new DateTime(‘NOW’);
    $date->add(new DateInterval(‘P90D’));
    $newcheckout=$date->format(‘Y-m-d H:i:s’);

    $sql = ‘UPDATE ‘.$this->DBTables->Sales;
    $sql .= ‘ SET saleCheckoutTime=”‘.$newcheckout.’”, saleTxnId=”‘.$txnid.’”, saleStatus=”Reserved”‘;
    $sql .= ‘ WHERE saleID=”‘.$saleid.’”‘;

    $this->query($sql);

    // Get the SaleId and return it ….
    $sql = ‘SELECT saleID FROM ‘.$this->DBTables->Sales;
    $sql .= ‘ WHERE saleID=”‘.$saleid.’”‘;

    $saleEntry = $this->get_results($sql);
    if (count($saleEntry) == 0)
    return 0;

    return $saleEntry[0]->saleId;
    }

    ———–

    This should add a transaction ID into the Sales Table as a booking is put ON HOLD.

    Thread Starter Mediatricks

    (@mediatricks)

    Hi Chris,

    In the Sales Table I have added the option to put the reservation on hold for those situations when a customer starts a booking but then has a problem, or asks to add seats before completing payment, or wants to pay offline/cash.

    I have added code hack so if a Reserved Booking is manually Confirmed in the back end, the DB is updated with a Sale Reference and the Paid Amount.

    1.
    In include/stageshow_sales_table.php

    Look for
    const BULKACTION_COMPLETED = ‘completed’;

    And add underneath:

    —————
    const BULKACTION_RESERVED = ‘reserved’;
    —————
    2. In include/stageshowlib_sales_dbase_api.php

    Add these two functions above the function GetSaleFromTxnID()

    —————
    //Update PAID on SET COMPLETE from Admin
    function UpdateSalePaid($saleid)
    {

    // Get the SaleId and return it ….
    $sql = ‘SELECT saleID, SUM(ticketPaid) as invTotal FROM ‘.$this->DBTables->Orders;
    $sql .= ‘ WHERE saleID=”‘.$saleid.'”‘;

    $Totals = $this->get_results($sql);

    $Paid= $Totals[0]->invTotal;
    $txnid = substr(md5(microtime()),rand(0,26),16);

    $sql = ‘UPDATE ‘.$this->DBTables->Sales;
    $sql .= ‘ SET salePaid=”‘.$Paid.'”, saleTxnId=”‘.$txnid.'”, salePPExpToken=””‘;
    $sql .= ‘ WHERE saleID=”‘.$saleid.'”‘;

    $this->query($sql);

    // Get the SaleId and return it ….
    $sql = ‘SELECT saleID FROM ‘.$this->DBTables->Sales;
    $sql .= ‘ WHERE saleTxnId=”‘.$txnid.'”‘;

    $saleEntry = $this->get_results($sql);
    if (count($saleEntry) == 0)
    return 0;

    return $saleEntry[0]->saleId;
    }

    // Update Set a Booking to RESERVED
    function UpdateSaleReserved($saleId)
    {

    date_default_timezone_set(‘Asia/Kuwait’);
    $date = new DateTime(‘NOW’);
    $date->add(new DateInterval(‘P90D’));
    $newcheckout=$date->format(‘Y-m-d H:i:s’);

    $sql = ‘UPDATE ‘.$this->DBTables->Sales;
    $sql .= ‘ SET saleCheckoutTime=”‘.$newcheckout.'”, saleStatus=”Reserved”‘;
    $sql .= ‘ WHERE saleID=”‘.$saleid.'”‘;

    $this->query($sql);

    // Get the SaleId and return it ….
    $sql = ‘SELECT saleID FROM ‘.$this->DBTables->Sales;
    $sql .= ‘ WHERE saleID=”‘.$saleid.'”‘;

    $saleEntry = $this->get_results($sql);
    if (count($saleEntry) == 0)
    return 0;

    return $saleEntry[0]->saleId;
    }
    —————

    3. In stageshowplus_sales_table.php

    Look at about line 39 – 43 for the bulkAction for Set Complete and add this modified copy AFTER it (before the closing } of the function.
    —————
    if (!$editMode)
    {
    $this->bulkActions = array_merge($this->bulkActions, array(
    self::BULKACTION_RESERVED => __(‘Hold Booking’, $this->myDomain),
    ));
    }
    —————

    4. In stageshowplus_manage_sales.php

    Look around Line 142 for Bulk Action for COMPLETED and add the following after the break; (Line 147?)
    —————

    case StageShowWPOrgSalesAdminListClass::BULKACTION_RESERVED:
    if ($actionCount > 0)
    $actionMsg = $actionCount . ‘ ‘ . _n(“Sale has been put on hold”, “Sales have been put on hold”, $actionCount, $this->myDomain);
    else
    $actionMsg = __(“Nothing to Update”, $this->myDomain);
    break;

    —————

    5. In stageshow_manage_sales.php

    Look for the DoBulkAction function at the bottom of the file and replace it with this:

    —————

    function DoBulkAction($bulkAction, $recordId)
    {
    switch ($bulkAction)
    {
    case StageShowWPOrgSalesAdminListClass::BULKACTION_COMPLETED:
    $saleResults = $this->myDBaseObj->GetSale($recordId);
    $saleEntry = $saleResults[0];

    // Check record can be changed to COMPLETED
    $prevSaleStatus = $saleEntry->saleStatus;

    // Get the sale entry
    if (!$this->CanChangeState($prevSaleStatus, PAYMENT_API_SALESTATUS_COMPLETED))
    return false;

    //HACK To Update Resered and Transaction Data
    $this->myDBaseObj->UpdateSalePaid($recordId);
    $this->myDBaseObj->UpdateSaleIDStatus($recordId, PAYMENT_API_SALESTATUS_COMPLETED);

    if ($prevSaleStatus == PAYMENT_API_SALESTATUS_RESERVED || $prevSaleStatus == PAYMENT_API_SALESTATUS_CHECKOUT)
    {
    // Previously Unverified Sale is confirmed – Send EMail to Purchaser
    $this->myDBaseObj->EMailSale($saleEntry->saleID);
    }
    return true;

    case StageShowWPOrgSalesAdminListClass::BULKACTION_RESERVED:
    $saleResults = $this->myDBaseObj->GetSale($recordId);
    $saleEntry = $saleResults[0];

    // Check record can be changed to COMPLETED
    $prevSaleStatus = $saleEntry->saleStatus;

    // Get the sale entry
    //if (!$this->CanChangeState($prevSaleStatus, PAYMENT_API_SALESTATUS_COMPLETED))
    // return false;

    // //HACK Change saleStatus to RESERVED

    $this->myDBaseObj->UpdateSaleIDStatus($recordId, PAYMENT_API_SALESTATUS_RESERVED);

    if ($prevSaleStatus == PAYMENT_API_SALESTATUS_UNVERIFIED || $prevSaleStatus == PAYMENT_API_SALESTATUS_CHECKOUT)
    {

    // Previously Unverified OR CHECKOUT Sale is confirmed – Send EMail to Purchaser
    $this->myDBaseObj->UpdateSaleReserved($recordId);
    }
    return true;
    }

    return parent::DoBulkAction($bulkAction, $recordId);
    }

    —————

    (That will leave two } } before the closing php tag. )

    That should do it (unless I missed a file) and you will be able to switch records between COMPLETED and ON HOLD (Reserved) in the back end sales table.

    Thread Starter Mediatricks

    (@mediatricks)

    Aggghgh! I am an idiot! The include file was calling /stageshowgold/ folder and the new plugin is just /stageshow/ .

    Sorry to bother you. But please consider adding these two features:

    1. ID column in the Sales Table
    2. The ability to change a sale from Checkout to Reserved. It is very useful for Backoffice management or putting seats on hold for customers who will pay offline. I have added it as a BulkAction in the Sales Table.

    ??

    Having the same problem. https://doublea.studio. Descriptions do not break at words/spaces which is very annoying.

    • This reply was modified 6 years, 5 months ago by Mediatricks.

    I agree. Regularly curse that my quick tally of sales income was inaccurate as I hadn’t deleted pending sales.

    Are you using Buddypress? If so, check out this variation?

    https://mediatricks.com/2012/09/buddypress-version-of-baw-easy-invitation-codes-plugin/

    I loved Julio’s original plugin but needed it to work on BP too so made a BP specific version you can get here: https://mediatricks.com/2012/09/buddypress-version-of-baw-easy-invitation-codes-plugin/

    You can use the caption and description information neatly in plugins like Viva Zoom https://www.mediatricks.biz/zoom that uses HS to pop out your image and show the extra info.

    Thread Starter Mediatricks

    (@mediatricks)

    I just did a complete fresh install with WP 2.5.1 (as my previous sites had just upgraded from 2.5) and this problem appears straight away – without renaming the Uncategorized category.

    I think this is a bugin WP 2.5.1

    Tim

    You could also try Viva Thumbs Plugin at https://www.mediatricks.biz/demo. It thumbnails on the fly and adds a default category linked image if there is no image in the post.

    Thread Starter Mediatricks

    (@mediatricks)

    UPDATE: It is definitely something to do with the Exif data or metadata. When I emptied the post_meta table of all the refernces to image attachments my Manage Media Library page displays correctly with a row for each image – but the image thumbnails are now blank in each row.

    I have a similar problem but slightly stranger.

    I can see all the images in my Manage media Library page one minute. then I add another image or two and they all fail to display.

    As mentioned above the Image (Count) is correct but there are no rows in the page and I cannot edit/delete any images.

    I can’t seem to pin this down to anything specific.

    Any ideas?

Viewing 15 replies - 1 through 15 (of 21 total)