Refactor payment confirmation template and fix status check

This commit is contained in:
2024-10-29 11:25:46 +01:00
parent 082feb6f2a
commit fbb0231089
25 changed files with 1595 additions and 1928 deletions

View File

@@ -202,8 +202,12 @@ class ShopBasket
$values['wp'] = \front\factory\ShopProduct::product_wp( $values[ 'product-id' ] );
$attributes_implode = '';
// generuj unikalny kod produktu dodanego do koszyka
$product_code = md5( $values['product-id'] . implode( '|', $attributes ) . $values['product-message'] . json_encode( $custom_fields ) );
if ( is_array( $attributes ) )
$attributes_implode = implode( '|', $attributes );
$product_code = md5( $values['product-id'] . $attributes_implode . $values['product-message'] . json_encode( $custom_fields ) );
if ( isset( $basket[ $product_code ] ) )
$basket[ $product_code ][ 'quantity' ] += $values[ 'quantity' ];

View File

@@ -18,6 +18,8 @@ class ShopOrder
{
global $mdb;
file_put_contents( 'tpay.txt', print_r( $_POST, true ) . print_r( $_GET, true ), FILE_APPEND );
if ( \S::get( 'tr_status' ) == 'TRUE' and \S::get( 'tr_crc' ) )
{
$order = new \shop\Order( 0, \S::get( 'tr_crc' ) );